Instructions to use rombodawg/DeepMagic-Coder-7b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use rombodawg/DeepMagic-Coder-7b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="rombodawg/DeepMagic-Coder-7b") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("rombodawg/DeepMagic-Coder-7b") model = AutoModelForCausalLM.from_pretrained("rombodawg/DeepMagic-Coder-7b") 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use rombodawg/DeepMagic-Coder-7b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "rombodawg/DeepMagic-Coder-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": "rombodawg/DeepMagic-Coder-7b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/rombodawg/DeepMagic-Coder-7b
- SGLang
How to use rombodawg/DeepMagic-Coder-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 "rombodawg/DeepMagic-Coder-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": "rombodawg/DeepMagic-Coder-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 "rombodawg/DeepMagic-Coder-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": "rombodawg/DeepMagic-Coder-7b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use rombodawg/DeepMagic-Coder-7b with Docker Model Runner:
docker model run hf.co/rombodawg/DeepMagic-Coder-7b
Update README.md
Browse files
README.md
CHANGED
|
@@ -3,3 +3,30 @@ license: other
|
|
| 3 |
license_name: deepseek
|
| 4 |
license_link: https://github.com/deepseek-ai/DeepSeek-Coder/blob/main/LICENSE-MODEL
|
| 5 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
license_name: deepseek
|
| 4 |
license_link: https://github.com/deepseek-ai/DeepSeek-Coder/blob/main/LICENSE-MODEL
|
| 5 |
---
|
| 6 |
+
DeepMagic-Coder-7b
|
| 7 |
+
|
| 8 |
+

|
| 9 |
+
|
| 10 |
+
This is an extremely successful merge of the deepseek-coder-6.7b-instruct and Magicoder-S-DS-6.7B models, bringing an uplift in overall coding performance without any comprimise to the models integrity (at least with limited testing).
|
| 11 |
+
|
| 12 |
+
This is the first of my models to use the merge-kits *task_arithmetic* merging method. The method is detailed bellow, and I clearly very usefull for merging ai models that were fine-tuned from a common base:
|
| 13 |
+
```
|
| 14 |
+
Computes "task vectors" for each model by subtracting a base model. Merges the task vectors linearly and adds back the base. Works great for models that were fine tuned from a common ancestor. Also a super useful mental framework for several of the more involved merge methods.
|
| 15 |
+
```
|
| 16 |
+
|
| 17 |
+
The Merge was created using Mergekit and the paremeters can be found bellow:
|
| 18 |
+
```yaml
|
| 19 |
+
models:
|
| 20 |
+
- model: deepseek-ai_deepseek-coder-6.7b-instruct
|
| 21 |
+
parameters:
|
| 22 |
+
weight: 1
|
| 23 |
+
- model: ise-uiuc_Magicoder-S-DS-6.7B
|
| 24 |
+
parameters:
|
| 25 |
+
weight: 1
|
| 26 |
+
merge_method: task_arithmetic
|
| 27 |
+
base_model: ise-uiuc_Magicoder-S-DS-6.7B
|
| 28 |
+
parameters:
|
| 29 |
+
normalize: true
|
| 30 |
+
int8_mask: true
|
| 31 |
+
dtype: float16
|
| 32 |
+
```
|