Text Generation
Transformers
Safetensors
llama
text-generation-inference
Inference Endpoints
yuxiang630 commited on
Commit
69ef8b5
•
1 Parent(s): 8ea1055

feat: model card

Browse files
Files changed (3) hide show
  1. README.md +109 -1
  2. assets/overview.svg +0 -0
  3. assets/result.png +0 -0
README.md CHANGED
@@ -4,4 +4,112 @@ datasets:
4
  - ise-uiuc/Magicoder-OSS-Instruct-75K
5
  library_name: transformers
6
  pipeline_tag: text-generation
7
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  - ise-uiuc/Magicoder-OSS-Instruct-75K
5
  library_name: transformers
6
  pipeline_tag: text-generation
7
+ ---
8
+ # 🎩 Magicoder: Source Code Is All You Need
9
+
10
+ > Refer to our GitHub repo [ise-uiuc/magicoder](https://github.com/ise-uiuc/magicoder/) for an up-to-date introduction to the Magicoder family!
11
+
12
+ * 🎩**Magicoder** is a model family empowered by 🪄**OSS-Instruct**, a novel approach to enlightening LLMs with open-source code snippets for generating *low-bias* and *high-quality* instruction data for code.
13
+ * 🪄**OSS-Instruct** mitigates the *inherent bias* of the LLM-synthesized instruction data by empowering them with *a wealth of open-source references* to produce more diverse, realistic, and controllable data.
14
+
15
+ ![Overview of OSS-Instruct](assets/overview.svg)
16
+ ![Overview of Result](assets/result.png)
17
+
18
+ ## Model Details
19
+
20
+ ### Model Description
21
+
22
+ * **Developed by:**
23
+ [Yuxiang Wei](https://yuxiang.cs.illinois.edu),
24
+ [Zhe Wang](https://github.com/zhewang2001),
25
+ [Jiawei Liu](https://jiawei-site.github.io),
26
+ [Yifeng Ding](https://yifeng-ding.com),
27
+ [Lingming Zhang](https://lingming.cs.illinois.edu)
28
+ * **License:** [Llama 2](https://ai.meta.com/llama/license/)
29
+ * **Finetuned from model:** [CodeLlama-7b-Python-hf](https://huggingface.co/codellama/CodeLlama-7b-Python-hf)
30
+
31
+ ### Model Sources
32
+
33
+ * **Repository:** <https://github.com/ise-uiuc/magicoder>
34
+ * **Paper:** <https://arxiv.org/pdf/2312.02120.pdf>
35
+ * **Demo (powered by [Gradio](https://www.gradio.app)):**
36
+ <https://github.com/ise-uiuc/magicoder/tree/main/demo>
37
+
38
+ ### Training Data
39
+
40
+ * [Magicoder-OSS-Instruct-75K](https://huggingface.co/datasets/ise-uiuc/Magicoder_oss_instruct_75k): generated through **OSS-Instruct** using `gpt-3.5-turbo-1106` and used to train both Magicoder and Magicoder-S series.
41
+
42
+ ## Uses
43
+
44
+ ### Direct Use
45
+
46
+ Magicoders are designed and best suited for **coding tasks**.
47
+
48
+ ### Out-of-Scope Use
49
+
50
+ Magicoders may not work well in non-coding tasks.
51
+
52
+ ## Bias, Risks, and Limitations
53
+
54
+ Magicoders may sometimes make errors, producing misleading contents, or struggle to manage tasks that are not related to coding.
55
+
56
+ ### Recommendations
57
+
58
+ Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model.
59
+
60
+ ## How to Get Started with the Model
61
+
62
+ Use the code below to get started with the model. Make sure you installed the [transformers](https://huggingface.co/docs/transformers/index) library.
63
+
64
+ ```python
65
+ from transformers import pipeline
66
+ import torch
67
+
68
+ MAGICODER_PROMPT = """You are an exceptionally intelligent coding assistant that consistently delivers accurate and reliable responses to user instructions.
69
+
70
+ @@ Instruction
71
+ {instruction}
72
+
73
+ @@ Response
74
+ """
75
+
76
+ instruction = <Your code instruction here>
77
+
78
+ prompt = MAGICODER_PROMPT.format(instruction=instruction)
79
+ generator = pipeline(
80
+ model="ise-uiuc/Magicoder-CL-7B",
81
+ task="text-generation",
82
+ torch_dtype=torch.bfloat16,
83
+ device_map="auto",
84
+ )
85
+ result = generator(prompt, max_length=1024, num_return_sequences=1, temperature=0.0)
86
+ print(result[0]["generated_text"])
87
+ ```
88
+
89
+ ## Technical Details
90
+
91
+ Refer to our GitHub repo: [ise-uiuc/magicoder](https://github.com/ise-uiuc/magicoder/).
92
+
93
+ ## Citation
94
+
95
+ ```bibtex
96
+ @misc{magicoder,
97
+ title={Magicoder: Source Code Is All You Need},
98
+ author={Yuxiang Wei and Zhe Wang and Jiawei Liu and Yifeng Ding and Lingming Zhang},
99
+ year={2023},
100
+ eprint={2312.02120},
101
+ archivePrefix={arXiv},
102
+ primaryClass={cs.CL}
103
+ }
104
+ ```
105
+
106
+ ## Acknowledgements
107
+
108
+ * [WizardCoder](https://github.com/nlpxucan/WizardLM/tree/main/WizardCoder): Evol-Instruct
109
+ * [DeepSeek-Coder](https://github.com/deepseek-ai/DeepSeek-Coder): Base model for Magicoder-DS
110
+ * [CodeLlama](https://ai.meta.com/research/publications/code-llama-open-foundation-models-for-code/): Base model for Magicoder-CL
111
+ * [StarCoder](https://arxiv.org/abs/2305.06161): Data decontamination
112
+
113
+ ## Important Note
114
+
115
+ Magicoder models are trained on the synthetic data generated by OpenAI models. Please pay attention to OpenAI's [terms of use](https://openai.com/policies/terms-of-use) when using the models and the datasets. Magicoders will not compete with OpenAI's commercial products.
assets/overview.svg ADDED
assets/result.png ADDED