Text Generation
Transformers
Safetensors
qwen2
on-policy-distillation
knowledge-distillation
synthetic-data
math
conversational
text-generation-inference
Instructions to use gasolsun/Math_DeepSeek-R1-Distill-Qwen-7B_Skywork-OR1-Math-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use gasolsun/Math_DeepSeek-R1-Distill-Qwen-7B_Skywork-OR1-Math-7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="gasolsun/Math_DeepSeek-R1-Distill-Qwen-7B_Skywork-OR1-Math-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("gasolsun/Math_DeepSeek-R1-Distill-Qwen-7B_Skywork-OR1-Math-7B") model = AutoModelForCausalLM.from_pretrained("gasolsun/Math_DeepSeek-R1-Distill-Qwen-7B_Skywork-OR1-Math-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 gasolsun/Math_DeepSeek-R1-Distill-Qwen-7B_Skywork-OR1-Math-7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "gasolsun/Math_DeepSeek-R1-Distill-Qwen-7B_Skywork-OR1-Math-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": "gasolsun/Math_DeepSeek-R1-Distill-Qwen-7B_Skywork-OR1-Math-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/gasolsun/Math_DeepSeek-R1-Distill-Qwen-7B_Skywork-OR1-Math-7B
- SGLang
How to use gasolsun/Math_DeepSeek-R1-Distill-Qwen-7B_Skywork-OR1-Math-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 "gasolsun/Math_DeepSeek-R1-Distill-Qwen-7B_Skywork-OR1-Math-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": "gasolsun/Math_DeepSeek-R1-Distill-Qwen-7B_Skywork-OR1-Math-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 "gasolsun/Math_DeepSeek-R1-Distill-Qwen-7B_Skywork-OR1-Math-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": "gasolsun/Math_DeepSeek-R1-Distill-Qwen-7B_Skywork-OR1-Math-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use gasolsun/Math_DeepSeek-R1-Distill-Qwen-7B_Skywork-OR1-Math-7B with Docker Model Runner:
docker model run hf.co/gasolsun/Math_DeepSeek-R1-Distill-Qwen-7B_Skywork-OR1-Math-7B
Add paper and code links
#1
by nielsr HF Staff - opened
README.md
CHANGED
|
@@ -1,18 +1,22 @@
|
|
| 1 |
---
|
| 2 |
-
license: mit
|
| 3 |
base_model: deepseek-ai/DeepSeek-R1-Distill-Qwen-7B
|
|
|
|
|
|
|
| 4 |
library_name: transformers
|
|
|
|
| 5 |
pipeline_tag: text-generation
|
| 6 |
tags:
|
| 7 |
- on-policy-distillation
|
| 8 |
- knowledge-distillation
|
| 9 |
- synthetic-data
|
| 10 |
- math
|
| 11 |
-
datasets:
|
| 12 |
-
- gasolsun/Math_DeepSeek-R1-Distill-Qwen-7B_Skywork-OR1-Math-7B
|
| 13 |
---
|
|
|
|
| 14 |
# Math_DeepSeek-R1-Distill-Qwen-7B_Skywork-OR1-Math-7B
|
| 15 |
|
|
|
|
|
|
|
|
|
|
| 16 |
[deepseek-ai/DeepSeek-R1-Distill-Qwen-7B](https://huggingface.co/deepseek-ai/DeepSeek-R1-Distill-Qwen-7B) distilled from [Skywork/Skywork-OR1-Math-7B](https://huggingface.co/Skywork/Skywork-OR1-Math-7B) with **Ask to Distill**.
|
| 17 |
|
| 18 |
**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.
|
|
@@ -48,4 +52,8 @@ out = model.generate(inputs, max_new_tokens=4096, do_sample=True, temperature=0.
|
|
| 48 |
print(tok.decode(out[0, inputs.shape[1]:], skip_special_tokens=True))
|
| 49 |
```
|
| 50 |
|
| 51 |
-
- Evaluation prompt (user turn): `Solve the following math problem step by step. The last line of your response should be of the form Answer: $Answer (without quotes) where $Answer is the answer to the problem.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
|
|
|
| 2 |
base_model: deepseek-ai/DeepSeek-R1-Distill-Qwen-7B
|
| 3 |
+
datasets:
|
| 4 |
+
- gasolsun/Math_DeepSeek-R1-Distill-Qwen-7B_Skywork-OR1-Math-7B
|
| 5 |
library_name: transformers
|
| 6 |
+
license: mit
|
| 7 |
pipeline_tag: text-generation
|
| 8 |
tags:
|
| 9 |
- on-policy-distillation
|
| 10 |
- knowledge-distillation
|
| 11 |
- synthetic-data
|
| 12 |
- math
|
|
|
|
|
|
|
| 13 |
---
|
| 14 |
+
|
| 15 |
# Math_DeepSeek-R1-Distill-Qwen-7B_Skywork-OR1-Math-7B
|
| 16 |
|
| 17 |
+
**Paper**: [Ask to Distill: Learning to Synthesize Data for On-Policy Distillation](https://huggingface.co/papers/2610.27450)
|
| 18 |
+
**Code**: [GitHub](https://github.com/GasolSun36/Ask_to_Distill)
|
| 19 |
+
|
| 20 |
[deepseek-ai/DeepSeek-R1-Distill-Qwen-7B](https://huggingface.co/deepseek-ai/DeepSeek-R1-Distill-Qwen-7B) distilled from [Skywork/Skywork-OR1-Math-7B](https://huggingface.co/Skywork/Skywork-OR1-Math-7B) with **Ask to Distill**.
|
| 21 |
|
| 22 |
**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.
|
|
|
|
| 52 |
print(tok.decode(out[0, inputs.shape[1]:], skip_special_tokens=True))
|
| 53 |
```
|
| 54 |
|
| 55 |
+
- Evaluation prompt (user turn): `Solve the following math problem step by step. The last line of your response should be of the form Answer: $Answer (without quotes) where $Answer is the answer to the problem.
|
| 56 |
+
|
| 57 |
+
{problem}
|
| 58 |
+
|
| 59 |
+
Remember to put your answer on its own line after "Answer:". Please reason step by step, and put your final answer within \\boxed{}.`
|