yuxiang630
commited on
Commit
•
a699712
1
Parent(s):
7e37b87
feat: README
Browse files- README.md +103 -1
- assets/overview.svg +0 -0
- assets/result.png +0 -0
README.md
CHANGED
@@ -6,4 +6,106 @@ datasets:
|
|
6 |
- ise-uiuc/Magicoder-Evol-Instruct-110K
|
7 |
library_name: transformers
|
8 |
pipeline_tag: text-generation
|
9 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
- ise-uiuc/Magicoder-Evol-Instruct-110K
|
7 |
library_name: transformers
|
8 |
pipeline_tag: text-generation
|
9 |
+
---
|
10 |
+
# 🎩 Magicoder: Source Code Is All You Need
|
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:** [DeepSeek](https://github.com/deepseek-ai/DeepSeek-Coder/blob/main/LICENSE-MODEL)
|
29 |
+
* **Finetuned from model:** [deepseek-coder-6.7b-base](https://huggingface.co/deepseek-ai/deepseek-coder-6.7b-base)
|
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 |
+
## Uses
|
39 |
+
|
40 |
+
### Direct Use
|
41 |
+
|
42 |
+
Magicoders are designed and best suited for **coding tasks**.
|
43 |
+
|
44 |
+
### Out-of-Scope Use
|
45 |
+
|
46 |
+
Magicoders may not work well in non-coding tasks.
|
47 |
+
|
48 |
+
## Bias, Risks, and Limitations
|
49 |
+
|
50 |
+
Magicoders may sometimes make errors, producing misleading contents, or struggle to manage tasks that are not related to coding.
|
51 |
+
|
52 |
+
### Recommendations
|
53 |
+
|
54 |
+
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model.
|
55 |
+
|
56 |
+
## How to Get Started with the Model
|
57 |
+
|
58 |
+
Use the code below to get started with the model. Make sure you installed the [transformers](https://huggingface.co/docs/transformers/index) library.
|
59 |
+
|
60 |
+
```python
|
61 |
+
from transformers import pipeline
|
62 |
+
import torch
|
63 |
+
|
64 |
+
MAGICODER_PROMPT = """You are an exceptionally intelligent coding assistant that consistently delivers accurate and reliable responses to user instructions.
|
65 |
+
|
66 |
+
@@ Instruction
|
67 |
+
{instruction}
|
68 |
+
|
69 |
+
@@ Response
|
70 |
+
"""
|
71 |
+
|
72 |
+
instruction = <Your code instruction here>
|
73 |
+
|
74 |
+
prompt = MAGICODER_PROMPT.format(instruction=instruction)
|
75 |
+
generator = pipeline(
|
76 |
+
model="ise-uiuc/Magicoder-S-DS-6.7B",
|
77 |
+
task="text-generation",
|
78 |
+
torch_dtype=torch.bfloat16,
|
79 |
+
device_map="auto",
|
80 |
+
)
|
81 |
+
result = generator(prompt, max_length=1024, num_return_sequences=1, temperature=0.0)
|
82 |
+
print(result[0]["generated_text"])
|
83 |
+
```
|
84 |
+
|
85 |
+
## Technical Details
|
86 |
+
|
87 |
+
Refer to our GitHub repo: [ise-uiuc/magicoder](https://github.com/ise-uiuc/magicoder/).
|
88 |
+
|
89 |
+
## 📝 Citation
|
90 |
+
|
91 |
+
```bibtex
|
92 |
+
@misc{magicoder,
|
93 |
+
title={Magicoder: Source Code Is All You Need},
|
94 |
+
author={Yuxiang Wei and Zhe Wang and Jiawei Liu and Yifeng Ding and Lingming Zhang},
|
95 |
+
year={2023},
|
96 |
+
eprint={2312.02120},
|
97 |
+
archivePrefix={arXiv},
|
98 |
+
primaryClass={cs.CL}
|
99 |
+
}
|
100 |
+
```
|
101 |
+
|
102 |
+
## 🙏 Acknowledgements
|
103 |
+
|
104 |
+
* [WizardCoder](https://github.com/nlpxucan/WizardLM/tree/main/WizardCoder): Evol-Instruct
|
105 |
+
* [DeepSeek-Coder](https://github.com/deepseek-ai/DeepSeek-Coder): Base model for Magicoder-DS
|
106 |
+
* [CodeLlama](https://ai.meta.com/research/publications/code-llama-open-foundation-models-for-code/): Base model for Magicoder-CL
|
107 |
+
* [StarCoder](https://arxiv.org/abs/2305.06161): Data decontamination
|
108 |
+
|
109 |
+
## Important Note
|
110 |
+
|
111 |
+
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