Text Generation
Transformers
Safetensors
qwen2
on-policy-distillation
knowledge-distillation
synthetic-data
code
conversational
text-generation-inference
Instructions to use gasolsun/Code_Qwen2.5-Coder-3B-Instruct_Qwen2.5-Coder-32B-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use gasolsun/Code_Qwen2.5-Coder-3B-Instruct_Qwen2.5-Coder-32B-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="gasolsun/Code_Qwen2.5-Coder-3B-Instruct_Qwen2.5-Coder-32B-Instruct") 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("gasolsun/Code_Qwen2.5-Coder-3B-Instruct_Qwen2.5-Coder-32B-Instruct") model = AutoModelForCausalLM.from_pretrained("gasolsun/Code_Qwen2.5-Coder-3B-Instruct_Qwen2.5-Coder-32B-Instruct", 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 gasolsun/Code_Qwen2.5-Coder-3B-Instruct_Qwen2.5-Coder-32B-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "gasolsun/Code_Qwen2.5-Coder-3B-Instruct_Qwen2.5-Coder-32B-Instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "gasolsun/Code_Qwen2.5-Coder-3B-Instruct_Qwen2.5-Coder-32B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/gasolsun/Code_Qwen2.5-Coder-3B-Instruct_Qwen2.5-Coder-32B-Instruct
- SGLang
How to use gasolsun/Code_Qwen2.5-Coder-3B-Instruct_Qwen2.5-Coder-32B-Instruct 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 "gasolsun/Code_Qwen2.5-Coder-3B-Instruct_Qwen2.5-Coder-32B-Instruct" \ --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": "gasolsun/Code_Qwen2.5-Coder-3B-Instruct_Qwen2.5-Coder-32B-Instruct", "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 "gasolsun/Code_Qwen2.5-Coder-3B-Instruct_Qwen2.5-Coder-32B-Instruct" \ --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": "gasolsun/Code_Qwen2.5-Coder-3B-Instruct_Qwen2.5-Coder-32B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use gasolsun/Code_Qwen2.5-Coder-3B-Instruct_Qwen2.5-Coder-32B-Instruct with Docker Model Runner:
docker model run hf.co/gasolsun/Code_Qwen2.5-Coder-3B-Instruct_Qwen2.5-Coder-32B-Instruct
Add paper and code links
#1
by nielsr HF Staff - opened
README.md
CHANGED
|
@@ -1,23 +1,27 @@
|
|
| 1 |
---
|
| 2 |
-
license: other
|
| 3 |
-
license_name: qwen-research
|
| 4 |
base_model: Qwen/Qwen2.5-Coder-3B-Instruct
|
|
|
|
|
|
|
| 5 |
library_name: transformers
|
|
|
|
|
|
|
| 6 |
pipeline_tag: text-generation
|
| 7 |
tags:
|
| 8 |
- on-policy-distillation
|
| 9 |
- knowledge-distillation
|
| 10 |
- synthetic-data
|
| 11 |
- code
|
| 12 |
-
datasets:
|
| 13 |
-
- gasolsun/Code_Qwen2.5-Coder-3B-Instruct_Qwen2.5-Coder-32B-Instruct
|
| 14 |
---
|
|
|
|
| 15 |
# Code_Qwen2.5-Coder-3B-Instruct_Qwen2.5-Coder-32B-Instruct
|
| 16 |
|
| 17 |
[Qwen/Qwen2.5-Coder-3B-Instruct](https://huggingface.co/Qwen/Qwen2.5-Coder-3B-Instruct) distilled from [Qwen/Qwen2.5-Coder-32B-Instruct](https://huggingface.co/Qwen/Qwen2.5-Coder-32B-Instruct) with **Ask to Distill**.
|
| 18 |
|
| 19 |
**Ask to Distill** trains a *question generator* with RL so that the questions it writes expose bounded, learnable token-level disagreement between a teacher and a student on the student's own solutions (the same signal on-policy distillation learns from). A question bank is then sampled from the generator, filtered and deduplicated, and the student is trained with on-policy distillation (OPD) on it. No real training questions and no reference answers are used.
|
| 20 |
|
|
|
|
|
|
|
|
|
|
| 21 |
## Training
|
| 22 |
|
| 23 |
| | |
|
|
@@ -49,4 +53,4 @@ out = model.generate(inputs, max_new_tokens=4096, do_sample=True, temperature=0.
|
|
| 49 |
print(tok.decode(out[0, inputs.shape[1]:], skip_special_tokens=True))
|
| 50 |
```
|
| 51 |
|
| 52 |
-
- Prompts use the LiveCodeBench stdin/stdout template (read from standard input, write to standard output, one fenced Python block).
|
|
|
|
| 1 |
---
|
|
|
|
|
|
|
| 2 |
base_model: Qwen/Qwen2.5-Coder-3B-Instruct
|
| 3 |
+
datasets:
|
| 4 |
+
- gasolsun/Code_Qwen2.5-Coder-3B-Instruct_Qwen2.5-Coder-32B-Instruct
|
| 5 |
library_name: transformers
|
| 6 |
+
license: other
|
| 7 |
+
license_name: qwen-research
|
| 8 |
pipeline_tag: text-generation
|
| 9 |
tags:
|
| 10 |
- on-policy-distillation
|
| 11 |
- knowledge-distillation
|
| 12 |
- synthetic-data
|
| 13 |
- code
|
|
|
|
|
|
|
| 14 |
---
|
| 15 |
+
|
| 16 |
# Code_Qwen2.5-Coder-3B-Instruct_Qwen2.5-Coder-32B-Instruct
|
| 17 |
|
| 18 |
[Qwen/Qwen2.5-Coder-3B-Instruct](https://huggingface.co/Qwen/Qwen2.5-Coder-3B-Instruct) distilled from [Qwen/Qwen2.5-Coder-32B-Instruct](https://huggingface.co/Qwen/Qwen2.5-Coder-32B-Instruct) with **Ask to Distill**.
|
| 19 |
|
| 20 |
**Ask to Distill** trains a *question generator* with RL so that the questions it writes expose bounded, learnable token-level disagreement between a teacher and a student on the student's own solutions (the same signal on-policy distillation learns from). A question bank is then sampled from the generator, filtered and deduplicated, and the student is trained with on-policy distillation (OPD) on it. No real training questions and no reference answers are used.
|
| 21 |
|
| 22 |
+
- **Paper**: [Ask to Distill: Learning to Synthesize Data for On-Policy Distillation](https://huggingface.co/papers/2610.27450)
|
| 23 |
+
- **Code**: [GitHub repository](https://github.com/GasolSun36/Ask_to_Distill)
|
| 24 |
+
|
| 25 |
## Training
|
| 26 |
|
| 27 |
| | |
|
|
|
|
| 53 |
print(tok.decode(out[0, inputs.shape[1]:], skip_special_tokens=True))
|
| 54 |
```
|
| 55 |
|
| 56 |
+
- Prompts use the LiveCodeBench stdin/stdout template (read from standard input, write to standard output, one fenced Python block).
|