Text Generation
Transformers
Safetensors
qwen2
llama-factory
full
Generated from Trainer
conversational
text-generation-inference
Instructions to use 17Lab/qwen1.5b-full-sft-s13 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use 17Lab/qwen1.5b-full-sft-s13 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="17Lab/qwen1.5b-full-sft-s13") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("17Lab/qwen1.5b-full-sft-s13") model = AutoModelForCausalLM.from_pretrained("17Lab/qwen1.5b-full-sft-s13", 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 17Lab/qwen1.5b-full-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-full-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-full-sft-s13", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/17Lab/qwen1.5b-full-sft-s13
- SGLang
How to use 17Lab/qwen1.5b-full-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-full-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-full-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-full-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-full-sft-s13", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use 17Lab/qwen1.5b-full-sft-s13 with Docker Model Runner:
docker model run hf.co/17Lab/qwen1.5b-full-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": 18.609325408935547, | |
| "learning_rate": 3.3333333333333335e-05, | |
| "loss": 3.100375747680664, | |
| "step": 5 | |
| }, | |
| { | |
| "epoch": 0.2631578947368421, | |
| "grad_norm": 7.61398458480835, | |
| "learning_rate": 4.990486745229364e-05, | |
| "loss": 0.7916615962982178, | |
| "step": 10 | |
| }, | |
| { | |
| "epoch": 0.39473684210526316, | |
| "grad_norm": 21.08771324157715, | |
| "learning_rate": 4.9326121764495596e-05, | |
| "loss": 0.2971171855926514, | |
| "step": 15 | |
| }, | |
| { | |
| "epoch": 0.5263157894736842, | |
| "grad_norm": 3.2525250911712646, | |
| "learning_rate": 4.823368810567056e-05, | |
| "loss": 0.20022857189178467, | |
| "step": 20 | |
| }, | |
| { | |
| "epoch": 0.6578947368421053, | |
| "grad_norm": 2.770566463470459, | |
| "learning_rate": 4.665063509461097e-05, | |
| "loss": 0.1185336947441101, | |
| "step": 25 | |
| }, | |
| { | |
| "epoch": 0.7894736842105263, | |
| "grad_norm": 0.9369506239891052, | |
| "learning_rate": 4.4610391622989396e-05, | |
| "loss": 0.05945125222206116, | |
| "step": 30 | |
| }, | |
| { | |
| "epoch": 0.9210526315789473, | |
| "grad_norm": 0.7369817495346069, | |
| "learning_rate": 4.215604094671835e-05, | |
| "loss": 0.04002172350883484, | |
| "step": 35 | |
| }, | |
| { | |
| "epoch": 1.0526315789473684, | |
| "grad_norm": 0.9492254257202148, | |
| "learning_rate": 3.933941090877615e-05, | |
| "loss": 0.020497632026672364, | |
| "step": 40 | |
| }, | |
| { | |
| "epoch": 1.1842105263157894, | |
| "grad_norm": 0.3728443682193756, | |
| "learning_rate": 3.621997950501156e-05, | |
| "loss": 0.012034893035888672, | |
| "step": 45 | |
| }, | |
| { | |
| "epoch": 1.3157894736842106, | |
| "grad_norm": 0.010420924983918667, | |
| "learning_rate": 3.2863618903790346e-05, | |
| "loss": 0.0003852380206808448, | |
| "step": 50 | |
| }, | |
| { | |
| "epoch": 1.3157894736842106, | |
| "eval_loss": 8.908205199986696e-05, | |
| "eval_runtime": 0.2398, | |
| "eval_samples_per_second": 1042.674, | |
| "eval_steps_per_second": 33.366, | |
| "step": 50 | |
| }, | |
| { | |
| "epoch": 1.4473684210526316, | |
| "grad_norm": 0.0057847267016768456, | |
| "learning_rate": 2.9341204441673266e-05, | |
| "loss": 6.551978876814246e-05, | |
| "step": 55 | |
| }, | |
| { | |
| "epoch": 1.5789473684210527, | |
| "grad_norm": 0.004835825879126787, | |
| "learning_rate": 2.5727117968577784e-05, | |
| "loss": 4.137617652304471e-05, | |
| "step": 60 | |
| }, | |
| { | |
| "epoch": 1.7105263157894737, | |
| "grad_norm": 0.00434767734259367, | |
| "learning_rate": 2.2097677146869242e-05, | |
| "loss": 3.404428716748953e-05, | |
| "step": 65 | |
| }, | |
| { | |
| "epoch": 1.8421052631578947, | |
| "grad_norm": 0.004089520312845707, | |
| "learning_rate": 1.852952387243698e-05, | |
| "loss": 3.0071102082729338e-05, | |
| "step": 70 | |
| }, | |
| { | |
| "epoch": 1.973684210526316, | |
| "grad_norm": 0.0039205304346978664, | |
| "learning_rate": 1.509800584902108e-05, | |
| "loss": 2.7886469615623356e-05, | |
| "step": 75 | |
| }, | |
| { | |
| "epoch": 2.1052631578947367, | |
| "grad_norm": 0.003841632977128029, | |
| "learning_rate": 1.1875585491636e-05, | |
| "loss": 2.677349839359522e-05, | |
| "step": 80 | |
| }, | |
| { | |
| "epoch": 2.236842105263158, | |
| "grad_norm": 0.0037360202986747026, | |
| "learning_rate": 8.930309757836517e-06, | |
| "loss": 2.9993365751579403e-05, | |
| "step": 85 | |
| }, | |
| { | |
| "epoch": 2.3684210526315788, | |
| "grad_norm": 0.003737943945452571, | |
| "learning_rate": 6.324373218975105e-06, | |
| "loss": 2.560944703873247e-05, | |
| "step": 90 | |
| }, | |
| { | |
| "epoch": 2.5, | |
| "grad_norm": 0.003710727905854583, | |
| "learning_rate": 4.112804714676594e-06, | |
| "loss": 2.5494518922641873e-05, | |
| "step": 95 | |
| }, | |
| { | |
| "epoch": 2.6315789473684212, | |
| "grad_norm": 0.0036761967930942774, | |
| "learning_rate": 2.3423053240837515e-06, | |
| "loss": 2.499283873476088e-05, | |
| "step": 100 | |
| }, | |
| { | |
| "epoch": 2.6315789473684212, | |
| "eval_loss": 2.4945922632468864e-05, | |
| "eval_runtime": 0.2256, | |
| "eval_samples_per_second": 1108.295, | |
| "eval_steps_per_second": 35.465, | |
| "step": 100 | |
| }, | |
| { | |
| "epoch": 2.763157894736842, | |
| "grad_norm": 0.0036698589101433754, | |
| "learning_rate": 1.0502621921127776e-06, | |
| "loss": 2.4992326507344843e-05, | |
| "step": 105 | |
| }, | |
| { | |
| "epoch": 2.8947368421052633, | |
| "grad_norm": 0.0036843419075012207, | |
| "learning_rate": 2.6395903547638825e-07, | |
| "loss": 2.493572246748954e-05, | |
| "step": 110 | |
| }, | |
| { | |
| "epoch": 3.0, | |
| "eval_loss": 2.4861023121047765e-05, | |
| "eval_runtime": 0.2248, | |
| "eval_samples_per_second": 1112.214, | |
| "eval_steps_per_second": 35.591, | |
| "step": 114 | |
| }, | |
| { | |
| "epoch": 3.0, | |
| "step": 114, | |
| "total_flos": 1.743788665995264e+16, | |
| "train_loss": 0.2035398631068937, | |
| "train_runtime": 208.2933, | |
| "train_samples_per_second": 68.413, | |
| "train_steps_per_second": 0.547 | |
| } | |
| ], | |
| "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.743788665995264e+16, | |
| "train_batch_size": 16, | |
| "trial_name": null, | |
| "trial_params": null | |
| } | |