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)# pip install -U transformers accelerate # 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", 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 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
End of training
Browse filesFiles changed (8)
28 unmodified lines2930313233343528 unmodified lines## Training procedure[<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/oi2qmn1n)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).28 unmodified lines2930313233343528 unmodified lines## Training procedure[<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/c99iczg5)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).
12345678{"total_flos": 0.0,"train_loss": 1.338229644823614e-07,"train_runtime": 85.7242,"train_samples": 35735,"train_samples_per_second": 2986.32,"train_steps_per_second": 5.833}12345678{"total_flos": 0.0,"train_loss": -1.764968340101791e-06,"train_runtime": 73.9907,"train_samples": 35735,"train_samples_per_second": 3459.895,"train_steps_per_second": 6.758}
21 unmodified lines2223242526272821 unmodified lines"tie_word_embeddings": true,"torch_dtype": "bfloat16","transformers_version": "4.52.3","use_cache": false,"use_sliding_window": false,"vocab_size": 151936}21 unmodified lines2223242526272821 unmodified lines"tie_word_embeddings": true,"torch_dtype": "bfloat16","transformers_version": "4.52.3","use_cache": true,"use_sliding_window": false,"vocab_size": 151936}
123version https://git-lfs.github.com/spec/v1oid sha256:7b1d502d4f82db4644242a755b9b94d4ffc8f3d1b72853af66ecd31a9576f466size 4957560304123version https://git-lfs.github.com/spec/v1oid sha256:a926a49b6a46bcd523ecf8460974cda609ec195d4a423c1030649f14261c0563size 4957560304
123version https://git-lfs.github.com/spec/v1oid sha256:6206f3f3cc2b9baa25ae4aa104637ab3541a459fab63b307ba4d9214702c398esize 1214366696123version https://git-lfs.github.com/spec/v1oid sha256:b4df150409cdbeb78dc565e4575a3d619a75c4f02d93a55f9d1ec8c545cddae5size 1214366696
12345678{"total_flos": 0.0,"train_loss": 1.338229644823614e-07,"train_runtime": 85.7242,"train_samples": 35735,"train_samples_per_second": 2986.32,"train_steps_per_second": 5.833}12345678{"total_flos": 0.0,"train_loss": -1.764968340101791e-06,"train_runtime": 73.9907,"train_samples": 35735,"train_samples_per_second": 3459.895,"train_steps_per_second": 6.758}
123version https://git-lfs.github.com/spec/v1oid sha256:23bee333f99f395c381089c2b3b9115dcc7dea96675d14499a0f8209ea7f8cbesize 8504123version https://git-lfs.github.com/spec/v1oid sha256:eabcb0a39ec9cc2897f47bea3ba4ffbeeaf91c51933728506734e4e390ba067asize 8504
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
training_args.bin+1-1