Text Generation
Transformers
Safetensors
qwen2
Generated from Trainer
open-r1
trl
grpo
conversational
text-generation-inference
Run this model with HF Jobs
Run Yukang/Qwen2.5-3B-Open-R1-Code-GRPO on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/Yukang/Qwen2.5-3B-Open-R1-Code-GRPO. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/Yukang/Qwen2.5-3B-Open-R1-Code-GRPO on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/Yukang/Qwen2.5-3B-Open-R1-Code-GRPO. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/Yukang/Qwen2.5-3B-Open-R1-Code-GRPO. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
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
Training in progress, step 507
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/7xzl1qw8)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/aj5h83cr)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.353820929619717e-07,"train_runtime": 83.2767,"train_samples": 35735,"train_samples_per_second": 3074.087,"train_steps_per_second": 6.004}12345678{"total_flos": 0.0,"train_loss": 2.729175465085761e-05,"train_runtime": 88.8114,"train_samples": 35735,"train_samples_per_second": 2882.513,"train_steps_per_second": 5.63}
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}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}
123version https://git-lfs.github.com/spec/v1oid sha256:021df71648e39c9d56c9cb0543ad93bd2478f709193564f2e11da4c38cc8e1edsize 4957560304123version https://git-lfs.github.com/spec/v1oid sha256:807f52796021308bdd2d6e1777c56cea61d79dcc4f52f7fe0a2982d630d096e1size 4957560304
123version https://git-lfs.github.com/spec/v1oid sha256:7f6fe8f4bf6d3bcf7175e3842980229ff86ab99b0dcea3b7097810965e2ab90esize 1214366696123version https://git-lfs.github.com/spec/v1oid sha256:dcceea148a083eef0c2d5de57f6c8b4b5eb6fcec6d1e69d13f6439bb9118b6afsize 1214366696
12345678{"total_flos": 0.0,"train_loss": 1.353820929619717e-07,"train_runtime": 83.2767,"train_samples": 35735,"train_samples_per_second": 3074.087,"train_steps_per_second": 6.004}12345678{"total_flos": 0.0,"train_loss": 2.729175465085761e-05,"train_runtime": 88.8114,"train_samples": 35735,"train_samples_per_second": 2882.513,"train_steps_per_second": 5.63}
123version https://git-lfs.github.com/spec/v1oid sha256:b66eec7eb2270f36351c96fa897e6a2df9e2d8b8376958c41a3bb878f3b232d3size 8504123version https://git-lfs.github.com/spec/v1oid sha256:b7eebea411dcd742359401d9414b70d4960ef23a73f06ce6752cda6bf7a9eea9size 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