Text Generation
Transformers
Safetensors
qwen2
Generated from Trainer
open-r1
trl
grpo
conversational
text-generation-inference
Instructions to use Yukang/Qwen2.5-3B-Open-R1-Code-GRPO with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Yukang/Qwen2.5-3B-Open-R1-Code-GRPO with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Yukang/Qwen2.5-3B-Open-R1-Code-GRPO") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Yukang/Qwen2.5-3B-Open-R1-Code-GRPO") model = AutoModelForCausalLM.from_pretrained("Yukang/Qwen2.5-3B-Open-R1-Code-GRPO") 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 Yukang/Qwen2.5-3B-Open-R1-Code-GRPO with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Yukang/Qwen2.5-3B-Open-R1-Code-GRPO" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Yukang/Qwen2.5-3B-Open-R1-Code-GRPO", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Yukang/Qwen2.5-3B-Open-R1-Code-GRPO
- SGLang
How to use Yukang/Qwen2.5-3B-Open-R1-Code-GRPO 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 "Yukang/Qwen2.5-3B-Open-R1-Code-GRPO" \ --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": "Yukang/Qwen2.5-3B-Open-R1-Code-GRPO", "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 "Yukang/Qwen2.5-3B-Open-R1-Code-GRPO" \ --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": "Yukang/Qwen2.5-3B-Open-R1-Code-GRPO", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Yukang/Qwen2.5-3B-Open-R1-Code-GRPO with Docker Model Runner:
docker model run hf.co/Yukang/Qwen2.5-3B-Open-R1-Code-GRPO
Training in progress, step 510
Browse files- README.md +1 -1
- all_results.json +4 -4
- config.json +1 -1
- model-00001-of-00002.safetensors +1 -1
- model-00002-of-00002.safetensors +1 -1
- train_results.json +4 -4
- trainer_state.json +0 -0
- training_args.bin +1 -1
README.md
CHANGED
|
@@ -29,7 +29,7 @@ print(output["generated_text"])
|
|
| 29 |
|
| 30 |
## Training procedure
|
| 31 |
|
| 32 |
-
[<img src="https://raw.githubusercontent.com/wandb/assets/main/wandb-github-badge-28.svg" alt="Visualize in Weights & Biases" width="150" height="24"/>](https://wandb.ai/chenyukang2020-nvidia/huggingface/runs/
|
| 33 |
|
| 34 |
|
| 35 |
This model was trained with GRPO, a method introduced in [DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models](https://huggingface.co/papers/2402.03300).
|
|
|
|
| 29 |
|
| 30 |
## Training procedure
|
| 31 |
|
| 32 |
+
[<img src="https://raw.githubusercontent.com/wandb/assets/main/wandb-github-badge-28.svg" alt="Visualize in Weights & Biases" width="150" height="24"/>](https://wandb.ai/chenyukang2020-nvidia/huggingface/runs/3c0353cy)
|
| 33 |
|
| 34 |
|
| 35 |
This model was trained with GRPO, a method introduced in [DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models](https://huggingface.co/papers/2402.03300).
|
all_results.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
{
|
| 2 |
"total_flos": 0.0,
|
| 3 |
-
"train_loss":
|
| 4 |
-
"train_runtime":
|
| 5 |
"train_samples": 35735,
|
| 6 |
-
"train_samples_per_second":
|
| 7 |
-
"train_steps_per_second": 6.
|
| 8 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"total_flos": 0.0,
|
| 3 |
+
"train_loss": 9.052564064315237e-07,
|
| 4 |
+
"train_runtime": 75.296,
|
| 5 |
"train_samples": 35735,
|
| 6 |
+
"train_samples_per_second": 3399.916,
|
| 7 |
+
"train_steps_per_second": 6.64
|
| 8 |
}
|
config.json
CHANGED
|
@@ -22,7 +22,7 @@
|
|
| 22 |
"tie_word_embeddings": true,
|
| 23 |
"torch_dtype": "bfloat16",
|
| 24 |
"transformers_version": "4.52.3",
|
| 25 |
-
"use_cache":
|
| 26 |
"use_sliding_window": false,
|
| 27 |
"vocab_size": 151936
|
| 28 |
}
|
|
|
|
| 22 |
"tie_word_embeddings": true,
|
| 23 |
"torch_dtype": "bfloat16",
|
| 24 |
"transformers_version": "4.52.3",
|
| 25 |
+
"use_cache": false,
|
| 26 |
"use_sliding_window": false,
|
| 27 |
"vocab_size": 151936
|
| 28 |
}
|
model-00001-of-00002.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 4957560304
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6eb6df84914c787eed2bf2a200ef3c85bbe9d288a43a32a6b00caf7521fab0e1
|
| 3 |
size 4957560304
|
model-00002-of-00002.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 1214366696
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:307cd5439b2d80cfe9a640f0053a40ea50ff56c6b5574102626f485412b8f5d1
|
| 3 |
size 1214366696
|
train_results.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
{
|
| 2 |
"total_flos": 0.0,
|
| 3 |
-
"train_loss":
|
| 4 |
-
"train_runtime":
|
| 5 |
"train_samples": 35735,
|
| 6 |
-
"train_samples_per_second":
|
| 7 |
-
"train_steps_per_second": 6.
|
| 8 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"total_flos": 0.0,
|
| 3 |
+
"train_loss": 9.052564064315237e-07,
|
| 4 |
+
"train_runtime": 75.296,
|
| 5 |
"train_samples": 35735,
|
| 6 |
+
"train_samples_per_second": 3399.916,
|
| 7 |
+
"train_steps_per_second": 6.64
|
| 8 |
}
|
trainer_state.json
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
training_args.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 8504
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9846bdd09191086fb5e7169a23b49f5974ac89201b2747a86923aa998fb05bfd
|
| 3 |
size 8504
|