Instructions to use ise-uiuc/Magicoder-S-DS-6.7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ise-uiuc/Magicoder-S-DS-6.7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ise-uiuc/Magicoder-S-DS-6.7B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ise-uiuc/Magicoder-S-DS-6.7B") model = AutoModelForCausalLM.from_pretrained("ise-uiuc/Magicoder-S-DS-6.7B", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ise-uiuc/Magicoder-S-DS-6.7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ise-uiuc/Magicoder-S-DS-6.7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ise-uiuc/Magicoder-S-DS-6.7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ise-uiuc/Magicoder-S-DS-6.7B
- SGLang
How to use ise-uiuc/Magicoder-S-DS-6.7B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "ise-uiuc/Magicoder-S-DS-6.7B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ise-uiuc/Magicoder-S-DS-6.7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "ise-uiuc/Magicoder-S-DS-6.7B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ise-uiuc/Magicoder-S-DS-6.7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use ise-uiuc/Magicoder-S-DS-6.7B with Docker Model Runner:
docker model run hf.co/ise-uiuc/Magicoder-S-DS-6.7B
Commit ·
eabeced
1
Parent(s): 466801d
tiny
Browse files
README.md
CHANGED
|
@@ -37,6 +37,11 @@ pipeline_tag: text-generation
|
|
| 37 |
* **Demo (powered by [Gradio](https://www.gradio.app)):**
|
| 38 |
<https://github.com/ise-uiuc/magicoder/tree/main/demo>
|
| 39 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
## Uses
|
| 41 |
|
| 42 |
### Direct Use
|
|
@@ -88,7 +93,7 @@ print(result[0]["generated_text"])
|
|
| 88 |
|
| 89 |
Refer to our GitHub repo: [ise-uiuc/magicoder](https://github.com/ise-uiuc/magicoder/).
|
| 90 |
|
| 91 |
-
##
|
| 92 |
|
| 93 |
```bibtex
|
| 94 |
@misc{magicoder,
|
|
@@ -101,7 +106,7 @@ Refer to our GitHub repo: [ise-uiuc/magicoder](https://github.com/ise-uiuc/magic
|
|
| 101 |
}
|
| 102 |
```
|
| 103 |
|
| 104 |
-
##
|
| 105 |
|
| 106 |
* [WizardCoder](https://github.com/nlpxucan/WizardLM/tree/main/WizardCoder): Evol-Instruct
|
| 107 |
* [DeepSeek-Coder](https://github.com/deepseek-ai/DeepSeek-Coder): Base model for Magicoder-DS
|
|
|
|
| 37 |
* **Demo (powered by [Gradio](https://www.gradio.app)):**
|
| 38 |
<https://github.com/ise-uiuc/magicoder/tree/main/demo>
|
| 39 |
|
| 40 |
+
### Training Data
|
| 41 |
+
|
| 42 |
+
* [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.
|
| 43 |
+
* [Magicoder-Evol-Instruct-110K](https://huggingface.co/datasets/ise-uiuc/Magicoder_evol_instruct_110k): decontaminated and redistributed from [theblackcat102/evol-codealpaca-v1](https://huggingface.co/datasets/theblackcat102/evol-codealpaca-v1), used to further finetune Magicoder series and obtain Magicoder-S models.
|
| 44 |
+
|
| 45 |
## Uses
|
| 46 |
|
| 47 |
### Direct Use
|
|
|
|
| 93 |
|
| 94 |
Refer to our GitHub repo: [ise-uiuc/magicoder](https://github.com/ise-uiuc/magicoder/).
|
| 95 |
|
| 96 |
+
## Citation
|
| 97 |
|
| 98 |
```bibtex
|
| 99 |
@misc{magicoder,
|
|
|
|
| 106 |
}
|
| 107 |
```
|
| 108 |
|
| 109 |
+
## Acknowledgements
|
| 110 |
|
| 111 |
* [WizardCoder](https://github.com/nlpxucan/WizardLM/tree/main/WizardCoder): Evol-Instruct
|
| 112 |
* [DeepSeek-Coder](https://github.com/deepseek-ai/DeepSeek-Coder): Base model for Magicoder-DS
|