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