Text Generation
Transformers
Safetensors
qwen2
Generated from Trainer
trl
sft
conversational
text-generation-inference
Instructions to use yliu279/Qwen2.5-1.5B-Open-R1-Distill with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use yliu279/Qwen2.5-1.5B-Open-R1-Distill with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="yliu279/Qwen2.5-1.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("yliu279/Qwen2.5-1.5B-Open-R1-Distill") model = AutoModelForCausalLM.from_pretrained("yliu279/Qwen2.5-1.5B-Open-R1-Distill", 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use yliu279/Qwen2.5-1.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 "yliu279/Qwen2.5-1.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": "yliu279/Qwen2.5-1.5B-Open-R1-Distill", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/yliu279/Qwen2.5-1.5B-Open-R1-Distill
- SGLang
How to use yliu279/Qwen2.5-1.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 "yliu279/Qwen2.5-1.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": "yliu279/Qwen2.5-1.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 "yliu279/Qwen2.5-1.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": "yliu279/Qwen2.5-1.5B-Open-R1-Distill", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use yliu279/Qwen2.5-1.5B-Open-R1-Distill with Docker Model Runner:
docker model run hf.co/yliu279/Qwen2.5-1.5B-Open-R1-Distill
| { | |
| "best_metric": null, | |
| "best_model_checkpoint": null, | |
| "epoch": 1.0, | |
| "eval_steps": 100, | |
| "global_step": 169, | |
| "is_hyper_param_search": false, | |
| "is_local_process_zero": true, | |
| "is_world_process_zero": true, | |
| "log_history": [ | |
| { | |
| "epoch": 0.029585798816568046, | |
| "grad_norm": 2.345923383249104, | |
| "learning_rate": 5.882352941176471e-06, | |
| "loss": 1.0993, | |
| "step": 5 | |
| }, | |
| { | |
| "epoch": 0.05917159763313609, | |
| "grad_norm": 1.6335322183312209, | |
| "learning_rate": 1.1764705882352942e-05, | |
| "loss": 1.0403, | |
| "step": 10 | |
| }, | |
| { | |
| "epoch": 0.08875739644970414, | |
| "grad_norm": 0.888690455557851, | |
| "learning_rate": 1.7647058823529414e-05, | |
| "loss": 0.9533, | |
| "step": 15 | |
| }, | |
| { | |
| "epoch": 0.11834319526627218, | |
| "grad_norm": 0.605993261283257, | |
| "learning_rate": 1.9980782984658682e-05, | |
| "loss": 0.8923, | |
| "step": 20 | |
| }, | |
| { | |
| "epoch": 0.14792899408284024, | |
| "grad_norm": 0.5403099510453803, | |
| "learning_rate": 1.9863613034027224e-05, | |
| "loss": 0.8552, | |
| "step": 25 | |
| }, | |
| { | |
| "epoch": 0.17751479289940827, | |
| "grad_norm": 0.4267437657956469, | |
| "learning_rate": 1.9641197940012136e-05, | |
| "loss": 0.8283, | |
| "step": 30 | |
| }, | |
| { | |
| "epoch": 0.20710059171597633, | |
| "grad_norm": 0.3762012115326478, | |
| "learning_rate": 1.9315910880512792e-05, | |
| "loss": 0.8229, | |
| "step": 35 | |
| }, | |
| { | |
| "epoch": 0.23668639053254437, | |
| "grad_norm": 0.3998961302483626, | |
| "learning_rate": 1.8891222681391853e-05, | |
| "loss": 0.8225, | |
| "step": 40 | |
| }, | |
| { | |
| "epoch": 0.26627218934911245, | |
| "grad_norm": 0.342439948416711, | |
| "learning_rate": 1.8371664782625287e-05, | |
| "loss": 0.8074, | |
| "step": 45 | |
| }, | |
| { | |
| "epoch": 0.2958579881656805, | |
| "grad_norm": 0.3352296025363329, | |
| "learning_rate": 1.7762780887657576e-05, | |
| "loss": 0.7977, | |
| "step": 50 | |
| }, | |
| { | |
| "epoch": 0.3254437869822485, | |
| "grad_norm": 0.36768006239209633, | |
| "learning_rate": 1.7071067811865477e-05, | |
| "loss": 0.7877, | |
| "step": 55 | |
| }, | |
| { | |
| "epoch": 0.35502958579881655, | |
| "grad_norm": 0.36930308125522143, | |
| "learning_rate": 1.6303906161279554e-05, | |
| "loss": 0.7981, | |
| "step": 60 | |
| }, | |
| { | |
| "epoch": 0.38461538461538464, | |
| "grad_norm": 0.34275948146940866, | |
| "learning_rate": 1.5469481581224274e-05, | |
| "loss": 0.7722, | |
| "step": 65 | |
| }, | |
| { | |
| "epoch": 0.41420118343195267, | |
| "grad_norm": 0.34687087953328755, | |
| "learning_rate": 1.4576697415156818e-05, | |
| "loss": 0.7741, | |
| "step": 70 | |
| }, | |
| { | |
| "epoch": 0.4437869822485207, | |
| "grad_norm": 0.33700806692364377, | |
| "learning_rate": 1.3635079705638298e-05, | |
| "loss": 0.7852, | |
| "step": 75 | |
| }, | |
| { | |
| "epoch": 0.47337278106508873, | |
| "grad_norm": 0.3522939324373813, | |
| "learning_rate": 1.2654675551080724e-05, | |
| "loss": 0.7666, | |
| "step": 80 | |
| }, | |
| { | |
| "epoch": 0.5029585798816568, | |
| "grad_norm": 0.3619113893769617, | |
| "learning_rate": 1.164594590280734e-05, | |
| "loss": 0.7706, | |
| "step": 85 | |
| }, | |
| { | |
| "epoch": 0.5325443786982249, | |
| "grad_norm": 0.35863352000524984, | |
| "learning_rate": 1.0619653946285948e-05, | |
| "loss": 0.77, | |
| "step": 90 | |
| }, | |
| { | |
| "epoch": 0.5621301775147929, | |
| "grad_norm": 0.37104751470544484, | |
| "learning_rate": 9.586750257511868e-06, | |
| "loss": 0.7771, | |
| "step": 95 | |
| }, | |
| { | |
| "epoch": 0.591715976331361, | |
| "grad_norm": 0.33460082793444174, | |
| "learning_rate": 8.558255959926533e-06, | |
| "loss": 0.753, | |
| "step": 100 | |
| }, | |
| { | |
| "epoch": 0.591715976331361, | |
| "eval_loss": 0.7880756258964539, | |
| "eval_runtime": 2.5843, | |
| "eval_samples_per_second": 49.529, | |
| "eval_steps_per_second": 1.548, | |
| "step": 100 | |
| }, | |
| { | |
| "epoch": 0.621301775147929, | |
| "grad_norm": 0.33434806985656634, | |
| "learning_rate": 7.545145128592009e-06, | |
| "loss": 0.7569, | |
| "step": 105 | |
| }, | |
| { | |
| "epoch": 0.650887573964497, | |
| "grad_norm": 0.34375919264856386, | |
| "learning_rate": 6.558227696373617e-06, | |
| "loss": 0.7681, | |
| "step": 110 | |
| }, | |
| { | |
| "epoch": 0.6804733727810651, | |
| "grad_norm": 0.30783918015441514, | |
| "learning_rate": 5.608034111526298e-06, | |
| "loss": 0.7623, | |
| "step": 115 | |
| }, | |
| { | |
| "epoch": 0.7100591715976331, | |
| "grad_norm": 0.29783614403168684, | |
| "learning_rate": 4.704702977392914e-06, | |
| "loss": 0.7513, | |
| "step": 120 | |
| }, | |
| { | |
| "epoch": 0.7396449704142012, | |
| "grad_norm": 0.34532558685306786, | |
| "learning_rate": 3.857872873103322e-06, | |
| "loss": 0.7538, | |
| "step": 125 | |
| }, | |
| { | |
| "epoch": 0.7692307692307693, | |
| "grad_norm": 0.31169209548812665, | |
| "learning_rate": 3.0765795095517026e-06, | |
| "loss": 0.7555, | |
| "step": 130 | |
| }, | |
| { | |
| "epoch": 0.7988165680473372, | |
| "grad_norm": 0.32263878055498957, | |
| "learning_rate": 2.369159318001937e-06, | |
| "loss": 0.7585, | |
| "step": 135 | |
| }, | |
| { | |
| "epoch": 0.8284023668639053, | |
| "grad_norm": 0.298827966210511, | |
| "learning_rate": 1.743160500034443e-06, | |
| "loss": 0.7498, | |
| "step": 140 | |
| }, | |
| { | |
| "epoch": 0.8579881656804734, | |
| "grad_norm": 0.31151200609129565, | |
| "learning_rate": 1.2052624879351105e-06, | |
| "loss": 0.7566, | |
| "step": 145 | |
| }, | |
| { | |
| "epoch": 0.8875739644970414, | |
| "grad_norm": 0.2945383987090428, | |
| "learning_rate": 7.612046748871327e-07, | |
| "loss": 0.7665, | |
| "step": 150 | |
| }, | |
| { | |
| "epoch": 0.9171597633136095, | |
| "grad_norm": 0.29723164358335574, | |
| "learning_rate": 4.1572517541747294e-07, | |
| "loss": 0.7613, | |
| "step": 155 | |
| }, | |
| { | |
| "epoch": 0.9467455621301775, | |
| "grad_norm": 0.2856829681814886, | |
| "learning_rate": 1.7251026952640583e-07, | |
| "loss": 0.7607, | |
| "step": 160 | |
| }, | |
| { | |
| "epoch": 0.9763313609467456, | |
| "grad_norm": 0.2754045142340606, | |
| "learning_rate": 3.4155069933301535e-08, | |
| "loss": 0.7445, | |
| "step": 165 | |
| }, | |
| { | |
| "epoch": 1.0, | |
| "step": 169, | |
| "total_flos": 76916824473600.0, | |
| "train_loss": 0.8026486360109769, | |
| "train_runtime": 1090.1375, | |
| "train_samples_per_second": 19.823, | |
| "train_steps_per_second": 0.155 | |
| } | |
| ], | |
| "logging_steps": 5, | |
| "max_steps": 169, | |
| "num_input_tokens_seen": 0, | |
| "num_train_epochs": 1, | |
| "save_steps": 500, | |
| "stateful_callbacks": { | |
| "TrainerControl": { | |
| "args": { | |
| "should_epoch_stop": false, | |
| "should_evaluate": false, | |
| "should_log": false, | |
| "should_save": false, | |
| "should_training_stop": false | |
| }, | |
| "attributes": {} | |
| } | |
| }, | |
| "total_flos": 76916824473600.0, | |
| "train_batch_size": 4, | |
| "trial_name": null, | |
| "trial_params": null | |
| } | |