Instructions to use 17Lab/qwen1.5b-lora-sft-s13 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use 17Lab/qwen1.5b-lora-sft-s13 with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-1.5B") model = PeftModel.from_pretrained(base_model, "17Lab/qwen1.5b-lora-sft-s13") - Transformers
How to use 17Lab/qwen1.5b-lora-sft-s13 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="17Lab/qwen1.5b-lora-sft-s13") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("17Lab/qwen1.5b-lora-sft-s13", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use 17Lab/qwen1.5b-lora-sft-s13 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "17Lab/qwen1.5b-lora-sft-s13" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "17Lab/qwen1.5b-lora-sft-s13", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/17Lab/qwen1.5b-lora-sft-s13
- SGLang
How to use 17Lab/qwen1.5b-lora-sft-s13 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 "17Lab/qwen1.5b-lora-sft-s13" \ --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": "17Lab/qwen1.5b-lora-sft-s13", "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 "17Lab/qwen1.5b-lora-sft-s13" \ --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": "17Lab/qwen1.5b-lora-sft-s13", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use 17Lab/qwen1.5b-lora-sft-s13 with Docker Model Runner:
docker model run hf.co/17Lab/qwen1.5b-lora-sft-s13
| { | |
| "best_global_step": null, | |
| "best_metric": null, | |
| "best_model_checkpoint": null, | |
| "epoch": 3.0, | |
| "eval_steps": 50, | |
| "global_step": 114, | |
| "is_hyper_param_search": false, | |
| "is_local_process_zero": true, | |
| "is_world_process_zero": true, | |
| "log_history": [ | |
| { | |
| "epoch": 0.13157894736842105, | |
| "grad_norm": 4.184950351715088, | |
| "learning_rate": 0.00013333333333333334, | |
| "loss": 3.352059555053711, | |
| "step": 5 | |
| }, | |
| { | |
| "epoch": 0.2631578947368421, | |
| "grad_norm": 13.914199829101562, | |
| "learning_rate": 0.00019961946980917456, | |
| "loss": 1.2419548034667969, | |
| "step": 10 | |
| }, | |
| { | |
| "epoch": 0.39473684210526316, | |
| "grad_norm": 1.7003947496414185, | |
| "learning_rate": 0.00019730448705798239, | |
| "loss": 0.38210115432739256, | |
| "step": 15 | |
| }, | |
| { | |
| "epoch": 0.5263157894736842, | |
| "grad_norm": 0.8145407438278198, | |
| "learning_rate": 0.00019293475242268223, | |
| "loss": 0.25728816986083985, | |
| "step": 20 | |
| }, | |
| { | |
| "epoch": 0.6578947368421053, | |
| "grad_norm": 0.325599730014801, | |
| "learning_rate": 0.00018660254037844388, | |
| "loss": 0.2286611557006836, | |
| "step": 25 | |
| }, | |
| { | |
| "epoch": 0.7894736842105263, | |
| "grad_norm": 0.35414496064186096, | |
| "learning_rate": 0.00017844156649195759, | |
| "loss": 0.21931443214416504, | |
| "step": 30 | |
| }, | |
| { | |
| "epoch": 0.9210526315789473, | |
| "grad_norm": 0.25363680720329285, | |
| "learning_rate": 0.0001686241637868734, | |
| "loss": 0.20419161319732665, | |
| "step": 35 | |
| }, | |
| { | |
| "epoch": 1.0526315789473684, | |
| "grad_norm": 0.16995428502559662, | |
| "learning_rate": 0.0001573576436351046, | |
| "loss": 0.18711493015289307, | |
| "step": 40 | |
| }, | |
| { | |
| "epoch": 1.1842105263157894, | |
| "grad_norm": 0.5772308707237244, | |
| "learning_rate": 0.00014487991802004623, | |
| "loss": 0.16793118715286254, | |
| "step": 45 | |
| }, | |
| { | |
| "epoch": 1.3157894736842106, | |
| "grad_norm": 0.2523488700389862, | |
| "learning_rate": 0.00013145447561516138, | |
| "loss": 0.15176668167114257, | |
| "step": 50 | |
| }, | |
| { | |
| "epoch": 1.3157894736842106, | |
| "eval_loss": 0.15131250023841858, | |
| "eval_runtime": 0.4149, | |
| "eval_samples_per_second": 602.57, | |
| "eval_steps_per_second": 19.282, | |
| "step": 50 | |
| }, | |
| { | |
| "epoch": 1.4473684210526316, | |
| "grad_norm": 0.010118631646037102, | |
| "learning_rate": 0.00011736481776669306, | |
| "loss": 0.15125420093536376, | |
| "step": 55 | |
| }, | |
| { | |
| "epoch": 1.5789473684210527, | |
| "grad_norm": 0.02765880525112152, | |
| "learning_rate": 0.00010290847187431113, | |
| "loss": 0.15109244585037232, | |
| "step": 60 | |
| }, | |
| { | |
| "epoch": 1.7105263157894737, | |
| "grad_norm": 0.005034108646214008, | |
| "learning_rate": 8.839070858747697e-05, | |
| "loss": 0.15083110332489014, | |
| "step": 65 | |
| }, | |
| { | |
| "epoch": 1.8421052631578947, | |
| "grad_norm": 0.00388790899887681, | |
| "learning_rate": 7.411809548974792e-05, | |
| "loss": 0.15069222450256348, | |
| "step": 70 | |
| }, | |
| { | |
| "epoch": 1.973684210526316, | |
| "grad_norm": 0.0032404710073024035, | |
| "learning_rate": 6.039202339608432e-05, | |
| "loss": 0.1506070613861084, | |
| "step": 75 | |
| }, | |
| { | |
| "epoch": 2.1052631578947367, | |
| "grad_norm": 0.0034807652700692415, | |
| "learning_rate": 4.7502341966544e-05, | |
| "loss": 0.15054476261138916, | |
| "step": 80 | |
| }, | |
| { | |
| "epoch": 2.236842105263158, | |
| "grad_norm": 0.0030651933047920465, | |
| "learning_rate": 3.5721239031346066e-05, | |
| "loss": 0.1505044221878052, | |
| "step": 85 | |
| }, | |
| { | |
| "epoch": 2.3684210526315788, | |
| "grad_norm": 0.003038919297978282, | |
| "learning_rate": 2.529749287590042e-05, | |
| "loss": 0.1504807472229004, | |
| "step": 90 | |
| }, | |
| { | |
| "epoch": 2.5, | |
| "grad_norm": 0.003026943188160658, | |
| "learning_rate": 1.6451218858706374e-05, | |
| "loss": 0.1504598617553711, | |
| "step": 95 | |
| }, | |
| { | |
| "epoch": 2.6315789473684212, | |
| "grad_norm": 0.002823486225679517, | |
| "learning_rate": 9.369221296335006e-06, | |
| "loss": 0.15044400691986085, | |
| "step": 100 | |
| }, | |
| { | |
| "epoch": 2.6315789473684212, | |
| "eval_loss": 0.15043434500694275, | |
| "eval_runtime": 0.4215, | |
| "eval_samples_per_second": 593.179, | |
| "eval_steps_per_second": 18.982, | |
| "step": 100 | |
| }, | |
| { | |
| "epoch": 2.763157894736842, | |
| "grad_norm": 0.0027727079577744007, | |
| "learning_rate": 4.20104876845111e-06, | |
| "loss": 0.15043517351150512, | |
| "step": 105 | |
| }, | |
| { | |
| "epoch": 2.8947368421052633, | |
| "grad_norm": 0.0027681535575538874, | |
| "learning_rate": 1.055836141905553e-06, | |
| "loss": 0.1504277229309082, | |
| "step": 110 | |
| }, | |
| { | |
| "epoch": 3.0, | |
| "eval_loss": 0.15042713284492493, | |
| "eval_runtime": 0.3385, | |
| "eval_samples_per_second": 738.621, | |
| "eval_steps_per_second": 23.636, | |
| "step": 114 | |
| }, | |
| { | |
| "epoch": 3.0, | |
| "step": 114, | |
| "total_flos": 1.842079609965773e+16, | |
| "train_loss": 0.3649343314923738, | |
| "train_runtime": 63.8114, | |
| "train_samples_per_second": 223.314, | |
| "train_steps_per_second": 1.787 | |
| } | |
| ], | |
| "logging_steps": 5, | |
| "max_steps": 114, | |
| "num_input_tokens_seen": 0, | |
| "num_train_epochs": 3, | |
| "save_steps": 50, | |
| "stateful_callbacks": { | |
| "TrainerControl": { | |
| "args": { | |
| "should_epoch_stop": false, | |
| "should_evaluate": false, | |
| "should_log": false, | |
| "should_save": true, | |
| "should_training_stop": true | |
| }, | |
| "attributes": {} | |
| } | |
| }, | |
| "total_flos": 1.842079609965773e+16, | |
| "train_batch_size": 16, | |
| "trial_name": null, | |
| "trial_params": null | |
| } | |