Text Generation
Transformers
Safetensors
llama
llama-factory
full
Generated from Trainer
conversational
text-generation-inference
Instructions to use stamina/time_sft_llama3_8b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use stamina/time_sft_llama3_8b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="stamina/time_sft_llama3_8b") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("stamina/time_sft_llama3_8b") model = AutoModelForCausalLM.from_pretrained("stamina/time_sft_llama3_8b") 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 stamina/time_sft_llama3_8b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "stamina/time_sft_llama3_8b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "stamina/time_sft_llama3_8b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/stamina/time_sft_llama3_8b
- SGLang
How to use stamina/time_sft_llama3_8b 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 "stamina/time_sft_llama3_8b" \ --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": "stamina/time_sft_llama3_8b", "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 "stamina/time_sft_llama3_8b" \ --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": "stamina/time_sft_llama3_8b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use stamina/time_sft_llama3_8b with Docker Model Runner:
docker model run hf.co/stamina/time_sft_llama3_8b
| { | |
| "best_global_step": null, | |
| "best_metric": null, | |
| "best_model_checkpoint": null, | |
| "epoch": 1.9913544668587897, | |
| "eval_steps": 500, | |
| "global_step": 172, | |
| "is_hyper_param_search": false, | |
| "is_local_process_zero": true, | |
| "is_world_process_zero": true, | |
| "log_history": [ | |
| { | |
| "epoch": 0.11527377521613832, | |
| "grad_norm": 171.84270796756888, | |
| "learning_rate": 1e-05, | |
| "loss": 7.5213, | |
| "step": 10 | |
| }, | |
| { | |
| "epoch": 0.23054755043227665, | |
| "grad_norm": 71.18526005667518, | |
| "learning_rate": 1.9997919281892066e-05, | |
| "loss": 2.6949, | |
| "step": 20 | |
| }, | |
| { | |
| "epoch": 0.345821325648415, | |
| "grad_norm": 35.289377723884236, | |
| "learning_rate": 1.9749279121818235e-05, | |
| "loss": 1.2043, | |
| "step": 30 | |
| }, | |
| { | |
| "epoch": 0.4610951008645533, | |
| "grad_norm": 29.91321108787678, | |
| "learning_rate": 1.9096319953545186e-05, | |
| "loss": 0.4223, | |
| "step": 40 | |
| }, | |
| { | |
| "epoch": 0.5763688760806917, | |
| "grad_norm": 29.728421740700277, | |
| "learning_rate": 1.8066121092375303e-05, | |
| "loss": 0.319, | |
| "step": 50 | |
| }, | |
| { | |
| "epoch": 0.69164265129683, | |
| "grad_norm": 12.666665039661433, | |
| "learning_rate": 1.67014066183756e-05, | |
| "loss": 1.4997, | |
| "step": 60 | |
| }, | |
| { | |
| "epoch": 0.8069164265129684, | |
| "grad_norm": 5.830243906512837, | |
| "learning_rate": 1.5058773536894685e-05, | |
| "loss": 0.3865, | |
| "step": 70 | |
| }, | |
| { | |
| "epoch": 0.9221902017291066, | |
| "grad_norm": 0.6725579543715984, | |
| "learning_rate": 1.3206344605527355e-05, | |
| "loss": 0.3256, | |
| "step": 80 | |
| }, | |
| { | |
| "epoch": 0.9913544668587896, | |
| "eval_loss": 0.33376210927963257, | |
| "eval_runtime": 160.3729, | |
| "eval_samples_per_second": 7.676, | |
| "eval_steps_per_second": 0.243, | |
| "step": 86 | |
| }, | |
| { | |
| "epoch": 1.0461095100864553, | |
| "grad_norm": 22.72698947915329, | |
| "learning_rate": 1.12209431687416e-05, | |
| "loss": 0.3396, | |
| "step": 90 | |
| }, | |
| { | |
| "epoch": 1.1613832853025936, | |
| "grad_norm": 35.31663927509379, | |
| "learning_rate": 9.184907164529369e-06, | |
| "loss": 1.0414, | |
| "step": 100 | |
| }, | |
| { | |
| "epoch": 1.276657060518732, | |
| "grad_norm": 15.234461882384329, | |
| "learning_rate": 7.182674431585703e-06, | |
| "loss": 0.2945, | |
| "step": 110 | |
| }, | |
| { | |
| "epoch": 1.3919308357348703, | |
| "grad_norm": 4.5894850781244925, | |
| "learning_rate": 5.297280930072632e-06, | |
| "loss": 0.2875, | |
| "step": 120 | |
| }, | |
| { | |
| "epoch": 1.5072046109510087, | |
| "grad_norm": 1.8047231611837777, | |
| "learning_rate": 3.6069171006444882e-06, | |
| "loss": 0.279, | |
| "step": 130 | |
| }, | |
| { | |
| "epoch": 1.622478386167147, | |
| "grad_norm": 6.716108780423517, | |
| "learning_rate": 2.1816851753197023e-06, | |
| "loss": 0.2826, | |
| "step": 140 | |
| }, | |
| { | |
| "epoch": 1.7377521613832854, | |
| "grad_norm": 10.755588629090013, | |
| "learning_rate": 1.0806919199730614e-06, | |
| "loss": 0.2821, | |
| "step": 150 | |
| }, | |
| { | |
| "epoch": 1.8530259365994235, | |
| "grad_norm": 14.856503210839454, | |
| "learning_rate": 3.4959737730860144e-07, | |
| "loss": 0.2813, | |
| "step": 160 | |
| }, | |
| { | |
| "epoch": 1.968299711815562, | |
| "grad_norm": 3.0018415920803245, | |
| "learning_rate": 1.872126806633068e-08, | |
| "loss": 0.2795, | |
| "step": 170 | |
| }, | |
| { | |
| "epoch": 1.9913544668587897, | |
| "eval_loss": 0.2755764126777649, | |
| "eval_runtime": 160.9571, | |
| "eval_samples_per_second": 7.648, | |
| "eval_steps_per_second": 0.242, | |
| "step": 172 | |
| }, | |
| { | |
| "epoch": 1.9913544668587897, | |
| "step": 172, | |
| "total_flos": 246479162703872.0, | |
| "train_loss": 1.034759297966957, | |
| "train_runtime": 24309.5779, | |
| "train_samples_per_second": 0.911, | |
| "train_steps_per_second": 0.007 | |
| } | |
| ], | |
| "logging_steps": 10, | |
| "max_steps": 172, | |
| "num_input_tokens_seen": 0, | |
| "num_train_epochs": 2, | |
| "save_steps": 500, | |
| "stateful_callbacks": { | |
| "TrainerControl": { | |
| "args": { | |
| "should_epoch_stop": false, | |
| "should_evaluate": false, | |
| "should_log": false, | |
| "should_save": true, | |
| "should_training_stop": true | |
| }, | |
| "attributes": {} | |
| } | |
| }, | |
| "total_flos": 246479162703872.0, | |
| "train_batch_size": 4, | |
| "trial_name": null, | |
| "trial_params": null | |
| } | |