Text Generation
Transformers
Safetensors
qwen2
Generated from Trainer
open-r1
trl
sft
conversational
text-generation-inference
Instructions to use jsonjiao/Qwen2.5-0.5B-Open-R1-Distill with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use jsonjiao/Qwen2.5-0.5B-Open-R1-Distill with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="jsonjiao/Qwen2.5-0.5B-Open-R1-Distill") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("jsonjiao/Qwen2.5-0.5B-Open-R1-Distill") model = AutoModelForCausalLM.from_pretrained("jsonjiao/Qwen2.5-0.5B-Open-R1-Distill") 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 Settings
- vLLM
How to use jsonjiao/Qwen2.5-0.5B-Open-R1-Distill with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "jsonjiao/Qwen2.5-0.5B-Open-R1-Distill" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jsonjiao/Qwen2.5-0.5B-Open-R1-Distill", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/jsonjiao/Qwen2.5-0.5B-Open-R1-Distill
- SGLang
How to use jsonjiao/Qwen2.5-0.5B-Open-R1-Distill 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 "jsonjiao/Qwen2.5-0.5B-Open-R1-Distill" \ --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": "jsonjiao/Qwen2.5-0.5B-Open-R1-Distill", "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 "jsonjiao/Qwen2.5-0.5B-Open-R1-Distill" \ --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": "jsonjiao/Qwen2.5-0.5B-Open-R1-Distill", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use jsonjiao/Qwen2.5-0.5B-Open-R1-Distill with Docker Model Runner:
docker model run hf.co/jsonjiao/Qwen2.5-0.5B-Open-R1-Distill
| { | |
| "best_global_step": null, | |
| "best_metric": null, | |
| "best_model_checkpoint": null, | |
| "epoch": 1.0, | |
| "eval_steps": 500, | |
| "global_step": 269, | |
| "is_hyper_param_search": false, | |
| "is_local_process_zero": true, | |
| "is_world_process_zero": true, | |
| "log_history": [ | |
| { | |
| "epoch": 0.01858736059479554, | |
| "grad_norm": 4.007935378868762, | |
| "learning_rate": 1.785714285714286e-05, | |
| "loss": 1.0011, | |
| "num_tokens": 10465392.0, | |
| "step": 5 | |
| }, | |
| { | |
| "epoch": 0.03717472118959108, | |
| "grad_norm": 1.779777071622888, | |
| "learning_rate": 3.571428571428572e-05, | |
| "loss": 0.9383, | |
| "num_tokens": 20951152.0, | |
| "step": 10 | |
| }, | |
| { | |
| "epoch": 0.055762081784386616, | |
| "grad_norm": 1.5165754407115957, | |
| "learning_rate": 4.9998292477583695e-05, | |
| "loss": 0.8576, | |
| "num_tokens": 31436912.0, | |
| "step": 15 | |
| }, | |
| { | |
| "epoch": 0.07434944237918216, | |
| "grad_norm": 1.1112753601995564, | |
| "learning_rate": 4.993855640118024e-05, | |
| "loss": 0.8136, | |
| "num_tokens": 41909269.0, | |
| "step": 20 | |
| }, | |
| { | |
| "epoch": 0.09293680297397769, | |
| "grad_norm": 0.8850229226974969, | |
| "learning_rate": 4.9793703194560106e-05, | |
| "loss": 0.7908, | |
| "num_tokens": 52353719.0, | |
| "step": 25 | |
| }, | |
| { | |
| "epoch": 0.11152416356877323, | |
| "grad_norm": 0.8157290536352468, | |
| "learning_rate": 4.9564282335552e-05, | |
| "loss": 0.7732, | |
| "num_tokens": 62792124.0, | |
| "step": 30 | |
| }, | |
| { | |
| "epoch": 0.13011152416356878, | |
| "grad_norm": 0.8304768081951895, | |
| "learning_rate": 4.9251164096056716e-05, | |
| "loss": 0.7563, | |
| "num_tokens": 73260442.0, | |
| "step": 35 | |
| }, | |
| { | |
| "epoch": 0.14869888475836432, | |
| "grad_norm": 0.7191983564484024, | |
| "learning_rate": 4.885553624080778e-05, | |
| "loss": 0.7385, | |
| "num_tokens": 83727556.0, | |
| "step": 40 | |
| }, | |
| { | |
| "epoch": 0.16728624535315986, | |
| "grad_norm": 1.1043662370540017, | |
| "learning_rate": 4.8378899521772935e-05, | |
| "loss": 0.7367, | |
| "num_tokens": 94201938.0, | |
| "step": 45 | |
| }, | |
| { | |
| "epoch": 0.18587360594795538, | |
| "grad_norm": 0.8443906045895648, | |
| "learning_rate": 4.78230619852879e-05, | |
| "loss": 0.7287, | |
| "num_tokens": 104670740.0, | |
| "step": 50 | |
| }, | |
| { | |
| "epoch": 0.20446096654275092, | |
| "grad_norm": 0.8981056349681326, | |
| "learning_rate": 4.719013211351733e-05, | |
| "loss": 0.7317, | |
| "num_tokens": 115151933.0, | |
| "step": 55 | |
| }, | |
| { | |
| "epoch": 0.22304832713754646, | |
| "grad_norm": 0.7188198075786009, | |
| "learning_rate": 4.648251082625975e-05, | |
| "loss": 0.7208, | |
| "num_tokens": 125607410.0, | |
| "step": 60 | |
| }, | |
| { | |
| "epoch": 0.241635687732342, | |
| "grad_norm": 0.8256122130547718, | |
| "learning_rate": 4.570288237343632e-05, | |
| "loss": 0.7187, | |
| "num_tokens": 136036466.0, | |
| "step": 65 | |
| }, | |
| { | |
| "epoch": 0.26022304832713755, | |
| "grad_norm": 0.7434853803962486, | |
| "learning_rate": 4.4854204152811567e-05, | |
| "loss": 0.7144, | |
| "num_tokens": 146502251.0, | |
| "step": 70 | |
| }, | |
| { | |
| "epoch": 0.2788104089219331, | |
| "grad_norm": 0.5368593293506128, | |
| "learning_rate": 4.39396954915706e-05, | |
| "loss": 0.71, | |
| "num_tokens": 156977308.0, | |
| "step": 75 | |
| }, | |
| { | |
| "epoch": 0.29739776951672864, | |
| "grad_norm": 0.5684059848173332, | |
| "learning_rate": 4.2962825434308415e-05, | |
| "loss": 0.7031, | |
| "num_tokens": 167423794.0, | |
| "step": 80 | |
| }, | |
| { | |
| "epoch": 0.3159851301115242, | |
| "grad_norm": 0.6000054082622095, | |
| "learning_rate": 4.1927299583755515e-05, | |
| "loss": 0.694, | |
| "num_tokens": 177900466.0, | |
| "step": 85 | |
| }, | |
| { | |
| "epoch": 0.3345724907063197, | |
| "grad_norm": 0.4683216334004466, | |
| "learning_rate": 4.083704604415748e-05, | |
| "loss": 0.6978, | |
| "num_tokens": 188373813.0, | |
| "step": 90 | |
| }, | |
| { | |
| "epoch": 0.35315985130111527, | |
| "grad_norm": 0.6564460791865333, | |
| "learning_rate": 3.969620052063012e-05, | |
| "loss": 0.6958, | |
| "num_tokens": 198859382.0, | |
| "step": 95 | |
| }, | |
| { | |
| "epoch": 0.37174721189591076, | |
| "grad_norm": 0.43872776684737724, | |
| "learning_rate": 3.850909063101328e-05, | |
| "loss": 0.6916, | |
| "num_tokens": 209345142.0, | |
| "step": 100 | |
| }, | |
| { | |
| "epoch": 0.3903345724907063, | |
| "grad_norm": 0.5046190722656403, | |
| "learning_rate": 3.728021948973421e-05, | |
| "loss": 0.691, | |
| "num_tokens": 219820636.0, | |
| "step": 105 | |
| }, | |
| { | |
| "epoch": 0.40892193308550184, | |
| "grad_norm": 0.5244162239520259, | |
| "learning_rate": 3.6014248625951984e-05, | |
| "loss": 0.6813, | |
| "num_tokens": 230306396.0, | |
| "step": 110 | |
| }, | |
| { | |
| "epoch": 0.4275092936802974, | |
| "grad_norm": 0.5719480684589926, | |
| "learning_rate": 3.4715980300780745e-05, | |
| "loss": 0.6857, | |
| "num_tokens": 240792156.0, | |
| "step": 115 | |
| }, | |
| { | |
| "epoch": 0.44609665427509293, | |
| "grad_norm": 0.478683730476968, | |
| "learning_rate": 3.339033929066841e-05, | |
| "loss": 0.6842, | |
| "num_tokens": 251259365.0, | |
| "step": 120 | |
| }, | |
| { | |
| "epoch": 0.4646840148698885, | |
| "grad_norm": 0.4095390097161309, | |
| "learning_rate": 3.204235420603273e-05, | |
| "loss": 0.6871, | |
| "num_tokens": 261736444.0, | |
| "step": 125 | |
| }, | |
| { | |
| "epoch": 0.483271375464684, | |
| "grad_norm": 0.4823863786072732, | |
| "learning_rate": 3.0677138416019556e-05, | |
| "loss": 0.6861, | |
| "num_tokens": 272205866.0, | |
| "step": 130 | |
| }, | |
| { | |
| "epoch": 0.5018587360594795, | |
| "grad_norm": 0.3712185789520159, | |
| "learning_rate": 2.9299870651742188e-05, | |
| "loss": 0.6803, | |
| "num_tokens": 282683327.0, | |
| "step": 135 | |
| }, | |
| { | |
| "epoch": 0.5204460966542751, | |
| "grad_norm": 0.43259713240817316, | |
| "learning_rate": 2.7915775361580428e-05, | |
| "loss": 0.6843, | |
| "num_tokens": 293122806.0, | |
| "step": 140 | |
| }, | |
| { | |
| "epoch": 0.5390334572490706, | |
| "grad_norm": 0.3914497825473669, | |
| "learning_rate": 2.6530102893058357e-05, | |
| "loss": 0.6831, | |
| "num_tokens": 303598947.0, | |
| "step": 145 | |
| }, | |
| { | |
| "epoch": 0.5576208178438662, | |
| "grad_norm": 0.34581475770903225, | |
| "learning_rate": 2.5148109576477802e-05, | |
| "loss": 0.6796, | |
| "num_tokens": 314077641.0, | |
| "step": 150 | |
| }, | |
| { | |
| "epoch": 0.5762081784386617, | |
| "grad_norm": 0.39302670660254074, | |
| "learning_rate": 2.3775037785857073e-05, | |
| "loss": 0.6684, | |
| "num_tokens": 324545386.0, | |
| "step": 155 | |
| }, | |
| { | |
| "epoch": 0.5947955390334573, | |
| "grad_norm": 0.35089723644158544, | |
| "learning_rate": 2.2416096052810688e-05, | |
| "loss": 0.6834, | |
| "num_tokens": 335031146.0, | |
| "step": 160 | |
| }, | |
| { | |
| "epoch": 0.6133828996282528, | |
| "grad_norm": 0.37127645861899733, | |
| "learning_rate": 2.1076439308804808e-05, | |
| "loss": 0.6597, | |
| "num_tokens": 345504904.0, | |
| "step": 165 | |
| }, | |
| { | |
| "epoch": 0.6319702602230484, | |
| "grad_norm": 0.35866979447691283, | |
| "learning_rate": 1.976114933073662e-05, | |
| "loss": 0.6708, | |
| "num_tokens": 355956520.0, | |
| "step": 170 | |
| }, | |
| { | |
| "epoch": 0.6505576208178439, | |
| "grad_norm": 0.3542786775444148, | |
| "learning_rate": 1.847521546401383e-05, | |
| "loss": 0.6726, | |
| "num_tokens": 366434348.0, | |
| "step": 175 | |
| }, | |
| { | |
| "epoch": 0.6691449814126395, | |
| "grad_norm": 0.3663755936620364, | |
| "learning_rate": 1.7223515696258592e-05, | |
| "loss": 0.6754, | |
| "num_tokens": 376908695.0, | |
| "step": 180 | |
| }, | |
| { | |
| "epoch": 0.6877323420074349, | |
| "grad_norm": 0.3973873941404514, | |
| "learning_rate": 1.60107981534296e-05, | |
| "loss": 0.6788, | |
| "num_tokens": 387384301.0, | |
| "step": 185 | |
| }, | |
| { | |
| "epoch": 0.7063197026022305, | |
| "grad_norm": 0.3099192574655377, | |
| "learning_rate": 1.484166308855398e-05, | |
| "loss": 0.6678, | |
| "num_tokens": 397835323.0, | |
| "step": 190 | |
| }, | |
| { | |
| "epoch": 0.724907063197026, | |
| "grad_norm": 0.332309833872801, | |
| "learning_rate": 1.372054543139188e-05, | |
| "loss": 0.6658, | |
| "num_tokens": 408298322.0, | |
| "step": 195 | |
| }, | |
| { | |
| "epoch": 0.7434944237918215, | |
| "grad_norm": 0.31105138947653627, | |
| "learning_rate": 1.2651697965228748e-05, | |
| "loss": 0.6733, | |
| "num_tokens": 418781566.0, | |
| "step": 200 | |
| }, | |
| { | |
| "epoch": 0.7620817843866171, | |
| "grad_norm": 0.30171220361735157, | |
| "learning_rate": 1.1639175194611693e-05, | |
| "loss": 0.6683, | |
| "num_tokens": 429246222.0, | |
| "step": 205 | |
| }, | |
| { | |
| "epoch": 0.7806691449814126, | |
| "grad_norm": 0.3197255345493862, | |
| "learning_rate": 1.0686817965224952e-05, | |
| "loss": 0.6616, | |
| "num_tokens": 439717644.0, | |
| "step": 210 | |
| }, | |
| { | |
| "epoch": 0.7992565055762082, | |
| "grad_norm": 0.29017687856686264, | |
| "learning_rate": 9.798238894246628e-06, | |
| "loss": 0.6725, | |
| "num_tokens": 450170885.0, | |
| "step": 215 | |
| }, | |
| { | |
| "epoch": 0.8178438661710037, | |
| "grad_norm": 0.30650176056828654, | |
| "learning_rate": 8.976808666454292e-06, | |
| "loss": 0.6673, | |
| "num_tokens": 460656645.0, | |
| "step": 220 | |
| }, | |
| { | |
| "epoch": 0.8364312267657993, | |
| "grad_norm": 0.3090230351140059, | |
| "learning_rate": 8.225643248063091e-06, | |
| "loss": 0.6578, | |
| "num_tokens": 471142405.0, | |
| "step": 225 | |
| }, | |
| { | |
| "epoch": 0.8550185873605948, | |
| "grad_norm": 0.2586717237531077, | |
| "learning_rate": 7.547592066798609e-06, | |
| "loss": 0.6635, | |
| "num_tokens": 481616409.0, | |
| "step": 230 | |
| }, | |
| { | |
| "epoch": 0.8736059479553904, | |
| "grad_norm": 0.28938628080409906, | |
| "learning_rate": 6.94522720304148e-06, | |
| "loss": 0.6621, | |
| "num_tokens": 492097674.0, | |
| "step": 235 | |
| }, | |
| { | |
| "epoch": 0.8921933085501859, | |
| "grad_norm": 0.26794626813474093, | |
| "learning_rate": 6.420833633045514e-06, | |
| "loss": 0.6594, | |
| "num_tokens": 502555042.0, | |
| "step": 240 | |
| }, | |
| { | |
| "epoch": 0.9107806691449815, | |
| "grad_norm": 0.2651571481097874, | |
| "learning_rate": 5.976400561240085e-06, | |
| "loss": 0.657, | |
| "num_tokens": 513031521.0, | |
| "step": 245 | |
| }, | |
| { | |
| "epoch": 0.929368029739777, | |
| "grad_norm": 0.26526678159109557, | |
| "learning_rate": 5.613613874496393e-06, | |
| "loss": 0.6667, | |
| "num_tokens": 523517281.0, | |
| "step": 250 | |
| }, | |
| { | |
| "epoch": 0.9479553903345725, | |
| "grad_norm": 0.25932352659544855, | |
| "learning_rate": 5.333849746981104e-06, | |
| "loss": 0.6625, | |
| "num_tokens": 533998146.0, | |
| "step": 255 | |
| }, | |
| { | |
| "epoch": 0.966542750929368, | |
| "grad_norm": 0.25169356243372, | |
| "learning_rate": 5.138169419856345e-06, | |
| "loss": 0.6577, | |
| "num_tokens": 544470561.0, | |
| "step": 260 | |
| }, | |
| { | |
| "epoch": 0.9851301115241635, | |
| "grad_norm": 0.257589406808037, | |
| "learning_rate": 5.027315175628478e-06, | |
| "loss": 0.6536, | |
| "num_tokens": 554934577.0, | |
| "step": 265 | |
| }, | |
| { | |
| "epoch": 1.0, | |
| "num_tokens": 562274609.0, | |
| "step": 269, | |
| "total_flos": 242189447725056.0, | |
| "train_loss": 0.7043104473099833, | |
| "train_runtime": 6478.7341, | |
| "train_samples_per_second": 5.295, | |
| "train_steps_per_second": 0.042 | |
| } | |
| ], | |
| "logging_steps": 5, | |
| "max_steps": 269, | |
| "num_input_tokens_seen": 0, | |
| "num_train_epochs": 1, | |
| "save_steps": 100, | |
| "stateful_callbacks": { | |
| "TrainerControl": { | |
| "args": { | |
| "should_epoch_stop": false, | |
| "should_evaluate": false, | |
| "should_log": false, | |
| "should_save": true, | |
| "should_training_stop": true | |
| }, | |
| "attributes": {} | |
| } | |
| }, | |
| "total_flos": 242189447725056.0, | |
| "train_batch_size": 16, | |
| "trial_name": null, | |
| "trial_params": null | |
| } | |