Text Generation
Transformers
Safetensors
English
qwen2
code-generation
conversational
text-generation-inference
Instructions to use luzimu/WebGen-LM-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use luzimu/WebGen-LM-7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="luzimu/WebGen-LM-7B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("luzimu/WebGen-LM-7B") model = AutoModelForCausalLM.from_pretrained("luzimu/WebGen-LM-7B", 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 luzimu/WebGen-LM-7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "luzimu/WebGen-LM-7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "luzimu/WebGen-LM-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/luzimu/WebGen-LM-7B
- SGLang
How to use luzimu/WebGen-LM-7B 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 "luzimu/WebGen-LM-7B" \ --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": "luzimu/WebGen-LM-7B", "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 "luzimu/WebGen-LM-7B" \ --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": "luzimu/WebGen-LM-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use luzimu/WebGen-LM-7B with Docker Model Runner:
docker model run hf.co/luzimu/WebGen-LM-7B
| { | |
| "best_metric": null, | |
| "best_model_checkpoint": null, | |
| "epoch": 2.0, | |
| "eval_steps": 500, | |
| "global_step": 35, | |
| "is_hyper_param_search": false, | |
| "is_local_process_zero": true, | |
| "is_world_process_zero": true, | |
| "log_history": [ | |
| { | |
| "epoch": 0.05714285714285714, | |
| "grad_norm": 1.4009249776551385, | |
| "learning_rate": 6.666666666666667e-06, | |
| "loss": 0.5021, | |
| "step": 1 | |
| }, | |
| { | |
| "epoch": 0.11428571428571428, | |
| "grad_norm": 1.3172016334722576, | |
| "learning_rate": 1.3333333333333333e-05, | |
| "loss": 0.5031, | |
| "step": 2 | |
| }, | |
| { | |
| "epoch": 0.17142857142857143, | |
| "grad_norm": 1.9178512673599353, | |
| "learning_rate": 2e-05, | |
| "loss": 0.5062, | |
| "step": 3 | |
| }, | |
| { | |
| "epoch": 0.22857142857142856, | |
| "grad_norm": 0.6793089435343439, | |
| "learning_rate": 2.6666666666666667e-05, | |
| "loss": 0.3354, | |
| "step": 4 | |
| }, | |
| { | |
| "epoch": 0.2857142857142857, | |
| "grad_norm": 1.0867703547107586, | |
| "learning_rate": 3.3333333333333335e-05, | |
| "loss": 0.3295, | |
| "step": 5 | |
| }, | |
| { | |
| "epoch": 0.34285714285714286, | |
| "grad_norm": 1.1377175787228226, | |
| "learning_rate": 4e-05, | |
| "loss": 0.2839, | |
| "step": 6 | |
| }, | |
| { | |
| "epoch": 0.4, | |
| "grad_norm": 0.8623901226975293, | |
| "learning_rate": 3.9951281005196486e-05, | |
| "loss": 0.2441, | |
| "step": 7 | |
| }, | |
| { | |
| "epoch": 0.45714285714285713, | |
| "grad_norm": 0.8780874884244323, | |
| "learning_rate": 3.980536137483141e-05, | |
| "loss": 0.1846, | |
| "step": 8 | |
| }, | |
| { | |
| "epoch": 0.5142857142857142, | |
| "grad_norm": 1.036351588780494, | |
| "learning_rate": 3.9562952014676116e-05, | |
| "loss": 0.1988, | |
| "step": 9 | |
| }, | |
| { | |
| "epoch": 0.5714285714285714, | |
| "grad_norm": 0.9238302281565456, | |
| "learning_rate": 3.922523391876638e-05, | |
| "loss": 0.1253, | |
| "step": 10 | |
| }, | |
| { | |
| "epoch": 0.6285714285714286, | |
| "grad_norm": 0.745481755876343, | |
| "learning_rate": 3.879385241571817e-05, | |
| "loss": 0.1447, | |
| "step": 11 | |
| }, | |
| { | |
| "epoch": 0.6857142857142857, | |
| "grad_norm": 0.4692969825008956, | |
| "learning_rate": 3.827090915285202e-05, | |
| "loss": 0.134, | |
| "step": 12 | |
| }, | |
| { | |
| "epoch": 0.7428571428571429, | |
| "grad_norm": 0.3469413634561151, | |
| "learning_rate": 3.7658951857178544e-05, | |
| "loss": 0.1054, | |
| "step": 13 | |
| }, | |
| { | |
| "epoch": 0.8, | |
| "grad_norm": 0.3346780699651986, | |
| "learning_rate": 3.696096192312852e-05, | |
| "loss": 0.1333, | |
| "step": 14 | |
| }, | |
| { | |
| "epoch": 0.8571428571428571, | |
| "grad_norm": 0.3533757350439061, | |
| "learning_rate": 3.6180339887498953e-05, | |
| "loss": 0.1203, | |
| "step": 15 | |
| }, | |
| { | |
| "epoch": 0.9142857142857143, | |
| "grad_norm": 0.44957677742996416, | |
| "learning_rate": 3.532088886237956e-05, | |
| "loss": 0.1085, | |
| "step": 16 | |
| }, | |
| { | |
| "epoch": 0.9714285714285714, | |
| "grad_norm": 0.1976618462257492, | |
| "learning_rate": 3.438679600677303e-05, | |
| "loss": 0.0992, | |
| "step": 17 | |
| }, | |
| { | |
| "epoch": 1.0285714285714285, | |
| "grad_norm": 0.31193519474612263, | |
| "learning_rate": 3.3382612127177166e-05, | |
| "loss": 0.1184, | |
| "step": 18 | |
| }, | |
| { | |
| "epoch": 1.0857142857142856, | |
| "grad_norm": 0.22230886552354823, | |
| "learning_rate": 3.2313229506513167e-05, | |
| "loss": 0.084, | |
| "step": 19 | |
| }, | |
| { | |
| "epoch": 1.1428571428571428, | |
| "grad_norm": 0.5273052165547153, | |
| "learning_rate": 3.1183858069414936e-05, | |
| "loss": 0.0695, | |
| "step": 20 | |
| }, | |
| { | |
| "epoch": 1.2, | |
| "grad_norm": 0.23099852286167058, | |
| "learning_rate": 3.0000000000000004e-05, | |
| "loss": 0.0727, | |
| "step": 21 | |
| }, | |
| { | |
| "epoch": 1.2571428571428571, | |
| "grad_norm": 0.15466036793183785, | |
| "learning_rate": 2.876742293578155e-05, | |
| "loss": 0.0726, | |
| "step": 22 | |
| }, | |
| { | |
| "epoch": 1.3142857142857143, | |
| "grad_norm": 0.19431796186289696, | |
| "learning_rate": 2.7492131868318247e-05, | |
| "loss": 0.066, | |
| "step": 23 | |
| }, | |
| { | |
| "epoch": 1.3714285714285714, | |
| "grad_norm": 0.16481956416422497, | |
| "learning_rate": 2.618033988749895e-05, | |
| "loss": 0.0607, | |
| "step": 24 | |
| }, | |
| { | |
| "epoch": 1.4285714285714286, | |
| "grad_norm": 0.15633451614042126, | |
| "learning_rate": 2.4838437911993355e-05, | |
| "loss": 0.062, | |
| "step": 25 | |
| }, | |
| { | |
| "epoch": 1.4857142857142858, | |
| "grad_norm": 0.13455769043413274, | |
| "learning_rate": 2.3472963553338614e-05, | |
| "loss": 0.0624, | |
| "step": 26 | |
| }, | |
| { | |
| "epoch": 1.5428571428571427, | |
| "grad_norm": 0.1652523888771218, | |
| "learning_rate": 2.209056926535307e-05, | |
| "loss": 0.0638, | |
| "step": 27 | |
| }, | |
| { | |
| "epoch": 1.6, | |
| "grad_norm": 0.14446078065937673, | |
| "learning_rate": 2.0697989934050025e-05, | |
| "loss": 0.0664, | |
| "step": 28 | |
| }, | |
| { | |
| "epoch": 1.657142857142857, | |
| "grad_norm": 0.16157608324940975, | |
| "learning_rate": 1.930201006594999e-05, | |
| "loss": 0.0612, | |
| "step": 29 | |
| }, | |
| { | |
| "epoch": 1.7142857142857144, | |
| "grad_norm": 0.1323142346848781, | |
| "learning_rate": 1.7909430734646936e-05, | |
| "loss": 0.0581, | |
| "step": 30 | |
| }, | |
| { | |
| "epoch": 1.7714285714285714, | |
| "grad_norm": 0.12523507914355167, | |
| "learning_rate": 1.6527036446661396e-05, | |
| "loss": 0.0563, | |
| "step": 31 | |
| }, | |
| { | |
| "epoch": 1.8285714285714287, | |
| "grad_norm": 0.12146649654970151, | |
| "learning_rate": 1.5161562088006649e-05, | |
| "loss": 0.0563, | |
| "step": 32 | |
| }, | |
| { | |
| "epoch": 1.8857142857142857, | |
| "grad_norm": 0.13345706731310938, | |
| "learning_rate": 1.3819660112501054e-05, | |
| "loss": 0.0562, | |
| "step": 33 | |
| }, | |
| { | |
| "epoch": 1.9428571428571428, | |
| "grad_norm": 0.7649272056527538, | |
| "learning_rate": 1.250786813168176e-05, | |
| "loss": 0.065, | |
| "step": 34 | |
| }, | |
| { | |
| "epoch": 2.0, | |
| "grad_norm": 0.30935655233065706, | |
| "learning_rate": 1.123257706421845e-05, | |
| "loss": 0.0614, | |
| "step": 35 | |
| } | |
| ], | |
| "logging_steps": 1.0, | |
| "max_steps": 51, | |
| "num_input_tokens_seen": 0, | |
| "num_train_epochs": 3, | |
| "save_steps": 500, | |
| "stateful_callbacks": { | |
| "TrainerControl": { | |
| "args": { | |
| "should_epoch_stop": false, | |
| "should_evaluate": false, | |
| "should_log": false, | |
| "should_save": true, | |
| "should_training_stop": false | |
| }, | |
| "attributes": {} | |
| } | |
| }, | |
| "total_flos": 36435683966976.0, | |
| "train_batch_size": 1, | |
| "trial_name": null, | |
| "trial_params": null | |
| } | |