ise-uiuc/Magicoder-DS-6.7B
38104
1---2license: other3library_name: transformers4datasets:5- ise-uiuc/Magicoder-OSS-Instruct-75K6license_name: deepseek7pipeline_tag: text-generation8---9# ๐ฉ Magicoder: Source Code Is All You Need10 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 161718 19## Model Details20 21### Model Description22 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 Sources33 34* **Repository:** <https://github.com/ise-uiuc/magicoder>35* **Paper:** <https://arxiv.org/abs/2312.02120>36* **Demo (powered by [Gradio](https://www.gradio.app)):**37<https://github.com/ise-uiuc/magicoder/tree/main/demo>38 39### Training Data40 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## Uses44 45### Direct Use46 47Magicoders are designed and best suited for **coding tasks**.48 49### Out-of-Scope Use50 51Magicoders may not work well in non-coding tasks.52 53## Bias, Risks, and Limitations54 55Magicoders may sometimes make errors, producing misleading contents, or struggle to manage tasks that are not related to coding.56 57### Recommendations58 59Users (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 Model62 63Use the code below to get started with the model. Make sure you installed the [transformers](https://huggingface.co/docs/transformers/index) library.64 65```python66from transformers import pipeline67import torch68 69MAGICODER_PROMPT = """You are an exceptionally intelligent coding assistant that consistently delivers accurate and reliable responses to user instructions.70 71@@ Instruction72{instruction}73 74@@ Response75"""76 77instruction = <Your code instruction here>78 79prompt = MAGICODER_PROMPT.format(instruction=instruction)80generator = pipeline(81 model="ise-uiuc/Magicoder-DS-6.7B",82 task="text-generation",83 torch_dtype=torch.bfloat16,84 device_map="auto",85)86result = generator(prompt, max_length=1024, num_return_sequences=1, temperature=0.0)87print(result[0]["generated_text"])88```89 90## Technical Details91 92Refer to our GitHub repo: [ise-uiuc/magicoder](https://github.com/ise-uiuc/magicoder/).93 94## ๐ Citation95 96```bibtex97@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## ๐ Acknowledgements108 109* [WizardCoder](https://github.com/nlpxucan/WizardLM/tree/main/WizardCoder): Evol-Instruct110* [DeepSeek-Coder](https://github.com/deepseek-ai/DeepSeek-Coder): Base model for Magicoder-DS111* [CodeLlama](https://ai.meta.com/research/publications/code-llama-open-foundation-models-for-code/): Base model for Magicoder-CL112* [StarCoder](https://arxiv.org/abs/2305.06161): Data decontamination113 114## Important Note115 116Magicoder 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.117 