Magicoders may not work well in non-coding tasks.
Magicoders may sometimes make errors, producing misleading contents, or struggle to manage tasks that are not related to coding.
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model.
Use the code below to get started with the model. Make sure you installed the
transformers library.
1from transformers import pipeline
2import torch
3
4MAGICODER_PROMPT = """You are an exceptionally intelligent coding assistant that consistently delivers accurate and reliable responses to user instructions.
5
6@@ Instruction
7{instruction}
8
9@@ Response
10"""
11
12instruction = <Your code instruction here>
13
14prompt = MAGICODER_PROMPT.format(instruction=instruction)
15generator = pipeline(
16 model="ise-uiuc/Magicoder-S-DS-6.7B",
17 task="text-generation",
18 torch_dtype=torch.bfloat16,
19 device_map="auto",
20)
21result = generator(prompt, max_length=1024, num_return_sequences=1, temperature=0.0)
22print(result[0]["generated_text"])
Refer to our GitHub repo:
ise-uiuc/magicoder.
1@misc{magicoder,
2 title={Magicoder: Source Code Is All You Need},
3 author={Yuxiang Wei and Zhe Wang and Jiawei Liu and Yifeng Ding and Lingming Zhang},
4 year={2023},
5 eprint={2312.02120},
6 archivePrefix={arXiv},
7 primaryClass={cs.CL}
8}
Magicoder models are trained on the synthetic data generated by OpenAI models. Please pay attention to OpenAI's
terms of use when using the models and the datasets. Magicoders will not compete with OpenAI's commercial products.