Views
No views yet
Refer to our GitHub repo ise-uiuc/magicoder for an up-to-date introduction to the Magicoder family!

gpt-3.5-turbo-1106 and used to train both Magicoder and Magicoder-S series.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-CL-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"])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}