Instructions to use 17Lab/qwen7b-lora-sft-s13 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use 17Lab/qwen7b-lora-sft-s13 with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-7B") model = PeftModel.from_pretrained(base_model, "17Lab/qwen7b-lora-sft-s13") - Transformers
How to use 17Lab/qwen7b-lora-sft-s13 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="17Lab/qwen7b-lora-sft-s13") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("17Lab/qwen7b-lora-sft-s13", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use 17Lab/qwen7b-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/qwen7b-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/qwen7b-lora-sft-s13", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/17Lab/qwen7b-lora-sft-s13
- SGLang
How to use 17Lab/qwen7b-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/qwen7b-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/qwen7b-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/qwen7b-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/qwen7b-lora-sft-s13", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use 17Lab/qwen7b-lora-sft-s13 with Docker Model Runner:
docker model run hf.co/17Lab/qwen7b-lora-sft-s13
| { | |
| "best_global_step": null, | |
| "best_metric": null, | |
| "best_model_checkpoint": null, | |
| "epoch": 3.0, | |
| "eval_steps": 50, | |
| "global_step": 225, | |
| "is_hyper_param_search": false, | |
| "is_local_process_zero": true, | |
| "is_world_process_zero": true, | |
| "log_history": [ | |
| { | |
| "epoch": 0.06666666666666667, | |
| "grad_norm": 3.3095102310180664, | |
| "learning_rate": 3.3333333333333335e-05, | |
| "loss": 3.553193283081055, | |
| "step": 5 | |
| }, | |
| { | |
| "epoch": 0.13333333333333333, | |
| "grad_norm": 3.525651454925537, | |
| "learning_rate": 7.500000000000001e-05, | |
| "loss": 2.196733856201172, | |
| "step": 10 | |
| }, | |
| { | |
| "epoch": 0.2, | |
| "grad_norm": 1.8955384492874146, | |
| "learning_rate": 9.997824750657585e-05, | |
| "loss": 0.5981613159179687, | |
| "step": 15 | |
| }, | |
| { | |
| "epoch": 0.26666666666666666, | |
| "grad_norm": 0.9316425919532776, | |
| "learning_rate": 9.973374926646116e-05, | |
| "loss": 0.25100862979888916, | |
| "step": 20 | |
| }, | |
| { | |
| "epoch": 0.3333333333333333, | |
| "grad_norm": 0.470761775970459, | |
| "learning_rate": 9.921889571113628e-05, | |
| "loss": 0.21380953788757323, | |
| "step": 25 | |
| }, | |
| { | |
| "epoch": 0.4, | |
| "grad_norm": 0.24911896884441376, | |
| "learning_rate": 9.843648561200475e-05, | |
| "loss": 0.19729268550872803, | |
| "step": 30 | |
| }, | |
| { | |
| "epoch": 0.4666666666666667, | |
| "grad_norm": 0.1331823319196701, | |
| "learning_rate": 9.73907721921212e-05, | |
| "loss": 0.19206844568252562, | |
| "step": 35 | |
| }, | |
| { | |
| "epoch": 0.5333333333333333, | |
| "grad_norm": 0.3001701235771179, | |
| "learning_rate": 9.608744000544392e-05, | |
| "loss": 0.1841310977935791, | |
| "step": 40 | |
| }, | |
| { | |
| "epoch": 0.6, | |
| "grad_norm": 0.025193708017468452, | |
| "learning_rate": 9.453357403529609e-05, | |
| "loss": 0.16237072944641112, | |
| "step": 45 | |
| }, | |
| { | |
| "epoch": 0.6666666666666666, | |
| "grad_norm": 0.01090251188725233, | |
| "learning_rate": 9.273762118001837e-05, | |
| "loss": 0.1566811203956604, | |
| "step": 50 | |
| }, | |
| { | |
| "epoch": 0.6666666666666666, | |
| "eval_loss": 0.15606221556663513, | |
| "eval_runtime": 0.812, | |
| "eval_samples_per_second": 307.886, | |
| "eval_steps_per_second": 9.852, | |
| "step": 50 | |
| }, | |
| { | |
| "epoch": 0.7333333333333333, | |
| "grad_norm": 0.00922091118991375, | |
| "learning_rate": 9.070934433517873e-05, | |
| "loss": 0.15580005645751954, | |
| "step": 55 | |
| }, | |
| { | |
| "epoch": 0.8, | |
| "grad_norm": 0.0077132065780460835, | |
| "learning_rate": 8.845976932195103e-05, | |
| "loss": 0.1553624153137207, | |
| "step": 60 | |
| }, | |
| { | |
| "epoch": 0.8666666666666667, | |
| "grad_norm": 0.007066451478749514, | |
| "learning_rate": 8.600112495016288e-05, | |
| "loss": 0.15475208759307862, | |
| "step": 65 | |
| }, | |
| { | |
| "epoch": 0.9333333333333333, | |
| "grad_norm": 0.005823033396154642, | |
| "learning_rate": 8.334677654183254e-05, | |
| "loss": 0.15437995195388793, | |
| "step": 70 | |
| }, | |
| { | |
| "epoch": 1.0, | |
| "grad_norm": 0.005354343447834253, | |
| "learning_rate": 8.051115327656538e-05, | |
| "loss": 0.1542748212814331, | |
| "step": 75 | |
| }, | |
| { | |
| "epoch": 1.0666666666666667, | |
| "grad_norm": 0.005110330879688263, | |
| "learning_rate": 7.750966975376328e-05, | |
| "loss": 0.15384273529052733, | |
| "step": 80 | |
| }, | |
| { | |
| "epoch": 1.1333333333333333, | |
| "grad_norm": 0.004773593507707119, | |
| "learning_rate": 7.435864219803983e-05, | |
| "loss": 0.153655743598938, | |
| "step": 85 | |
| }, | |
| { | |
| "epoch": 1.2, | |
| "grad_norm": 0.004483514931052923, | |
| "learning_rate": 7.10751997633524e-05, | |
| "loss": 0.15383241176605225, | |
| "step": 90 | |
| }, | |
| { | |
| "epoch": 1.2666666666666666, | |
| "grad_norm": 0.004061458632349968, | |
| "learning_rate": 6.767719141800717e-05, | |
| "loss": 0.1533586263656616, | |
| "step": 95 | |
| }, | |
| { | |
| "epoch": 1.3333333333333333, | |
| "grad_norm": 0.0037068487145006657, | |
| "learning_rate": 6.418308891671484e-05, | |
| "loss": 0.1532520055770874, | |
| "step": 100 | |
| }, | |
| { | |
| "epoch": 1.3333333333333333, | |
| "eval_loss": 0.15319058299064636, | |
| "eval_runtime": 0.7898, | |
| "eval_samples_per_second": 316.544, | |
| "eval_steps_per_second": 10.129, | |
| "step": 100 | |
| }, | |
| { | |
| "epoch": 1.4, | |
| "grad_norm": 0.0036922406870871782, | |
| "learning_rate": 6.0611886387146156e-05, | |
| "loss": 0.15315526723861694, | |
| "step": 105 | |
| }, | |
| { | |
| "epoch": 1.4666666666666668, | |
| "grad_norm": 0.003276499453932047, | |
| "learning_rate": 5.6982997076840306e-05, | |
| "loss": 0.15307013988494872, | |
| "step": 110 | |
| }, | |
| { | |
| "epoch": 1.5333333333333332, | |
| "grad_norm": 0.0030743591487407684, | |
| "learning_rate": 5.3316147821755205e-05, | |
| "loss": 0.15306075811386108, | |
| "step": 115 | |
| }, | |
| { | |
| "epoch": 1.6, | |
| "grad_norm": 0.002890027826651931, | |
| "learning_rate": 4.963127181013438e-05, | |
| "loss": 0.15295226573944093, | |
| "step": 120 | |
| }, | |
| { | |
| "epoch": 1.6666666666666665, | |
| "grad_norm": 0.002783812815323472, | |
| "learning_rate": 4.5948400224632e-05, | |
| "loss": 0.15291054248809816, | |
| "step": 125 | |
| }, | |
| { | |
| "epoch": 1.7333333333333334, | |
| "grad_norm": 0.0026604756712913513, | |
| "learning_rate": 4.228755335173488e-05, | |
| "loss": 0.15286383628845215, | |
| "step": 130 | |
| }, | |
| { | |
| "epoch": 1.8, | |
| "grad_norm": 0.002499212510883808, | |
| "learning_rate": 3.866863175041666e-05, | |
| "loss": 0.15282795429229737, | |
| "step": 135 | |
| }, | |
| { | |
| "epoch": 1.8666666666666667, | |
| "grad_norm": 0.0029253114480525255, | |
| "learning_rate": 3.511130807163724e-05, | |
| "loss": 0.1527980923652649, | |
| "step": 140 | |
| }, | |
| { | |
| "epoch": 1.9333333333333333, | |
| "grad_norm": 0.0025290725752711296, | |
| "learning_rate": 3.1634920116762176e-05, | |
| "loss": 0.15277599096298217, | |
| "step": 145 | |
| }, | |
| { | |
| "epoch": 2.0, | |
| "grad_norm": 0.002358167665079236, | |
| "learning_rate": 2.825836571624254e-05, | |
| "loss": 0.15276691913604737, | |
| "step": 150 | |
| }, | |
| { | |
| "epoch": 2.0, | |
| "eval_loss": 0.15274152159690857, | |
| "eval_runtime": 0.7897, | |
| "eval_samples_per_second": 316.557, | |
| "eval_steps_per_second": 10.13, | |
| "step": 150 | |
| }, | |
| { | |
| "epoch": 2.066666666666667, | |
| "grad_norm": 0.002371756825596094, | |
| "learning_rate": 2.500000000000001e-05, | |
| "loss": 0.1527329206466675, | |
| "step": 155 | |
| }, | |
| { | |
| "epoch": 2.1333333333333333, | |
| "grad_norm": 0.002244981937110424, | |
| "learning_rate": 2.187753561796097e-05, | |
| "loss": 0.15271611213684083, | |
| "step": 160 | |
| }, | |
| { | |
| "epoch": 2.2, | |
| "grad_norm": 0.002219752175733447, | |
| "learning_rate": 1.890794645314633e-05, | |
| "loss": 0.152712082862854, | |
| "step": 165 | |
| }, | |
| { | |
| "epoch": 2.2666666666666666, | |
| "grad_norm": 0.0022663031704723835, | |
| "learning_rate": 1.6107375350737437e-05, | |
| "loss": 0.1527017116546631, | |
| "step": 170 | |
| }, | |
| { | |
| "epoch": 2.3333333333333335, | |
| "grad_norm": 0.0020821872167289257, | |
| "learning_rate": 1.3491046364708293e-05, | |
| "loss": 0.15268385410308838, | |
| "step": 175 | |
| }, | |
| { | |
| "epoch": 2.4, | |
| "grad_norm": 0.002131885616108775, | |
| "learning_rate": 1.1073181999055538e-05, | |
| "loss": 0.15267916917800903, | |
| "step": 180 | |
| }, | |
| { | |
| "epoch": 2.466666666666667, | |
| "grad_norm": 0.0020295437425374985, | |
| "learning_rate": 8.866925893507805e-06, | |
| "loss": 0.152678918838501, | |
| "step": 185 | |
| }, | |
| { | |
| "epoch": 2.533333333333333, | |
| "grad_norm": 0.002005334012210369, | |
| "learning_rate": 6.8842713739986075e-06, | |
| "loss": 0.15267302989959716, | |
| "step": 190 | |
| }, | |
| { | |
| "epoch": 2.6, | |
| "grad_norm": 0.0021423636935651302, | |
| "learning_rate": 5.135996256306619e-06, | |
| "loss": 0.15266704559326172, | |
| "step": 195 | |
| }, | |
| { | |
| "epoch": 2.6666666666666665, | |
| "grad_norm": 0.001974227372556925, | |
| "learning_rate": 3.631604257273774e-06, | |
| "loss": 0.15267045497894288, | |
| "step": 200 | |
| }, | |
| { | |
| "epoch": 2.6666666666666665, | |
| "eval_loss": 0.15265707671642303, | |
| "eval_runtime": 0.7886, | |
| "eval_samples_per_second": 317.034, | |
| "eval_steps_per_second": 10.145, | |
| "step": 200 | |
| }, | |
| { | |
| "epoch": 2.7333333333333334, | |
| "grad_norm": 0.0023210777435451746, | |
| "learning_rate": 2.3792733320934346e-06, | |
| "loss": 0.15267107486724854, | |
| "step": 205 | |
| }, | |
| { | |
| "epoch": 2.8, | |
| "grad_norm": 0.0020230039954185486, | |
| "learning_rate": 1.3858112185094418e-06, | |
| "loss": 0.1526672959327698, | |
| "step": 210 | |
| }, | |
| { | |
| "epoch": 2.8666666666666667, | |
| "grad_norm": 0.0019893497228622437, | |
| "learning_rate": 6.566184295904776e-07, | |
| "loss": 0.1526732087135315, | |
| "step": 215 | |
| }, | |
| { | |
| "epoch": 2.9333333333333336, | |
| "grad_norm": 0.0020170097704976797, | |
| "learning_rate": 1.9565889625275946e-07, | |
| "loss": 0.15266685485839843, | |
| "step": 220 | |
| }, | |
| { | |
| "epoch": 3.0, | |
| "grad_norm": 0.001985270995646715, | |
| "learning_rate": 5.438419120062932e-09, | |
| "loss": 0.15266673564910888, | |
| "step": 225 | |
| }, | |
| { | |
| "epoch": 3.0, | |
| "eval_loss": 0.1526603251695633, | |
| "eval_runtime": 0.7874, | |
| "eval_samples_per_second": 317.482, | |
| "eval_steps_per_second": 10.159, | |
| "step": 225 | |
| }, | |
| { | |
| "epoch": 3.0, | |
| "step": 225, | |
| "total_flos": 9.49777223122944e+16, | |
| "train_loss": 0.29038675096299915, | |
| "train_runtime": 174.0086, | |
| "train_samples_per_second": 81.892, | |
| "train_steps_per_second": 1.293 | |
| } | |
| ], | |
| "logging_steps": 5, | |
| "max_steps": 225, | |
| "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": 9.49777223122944e+16, | |
| "train_batch_size": 8, | |
| "trial_name": null, | |
| "trial_params": null | |
| } | |