Text Generation
Transformers
TensorBoard
Safetensors
llama
alignment-handbook
trl
sft
Generated from Trainer
conversational
text-generation-inference
Instructions to use tanliboy/llama-3.2-3b-sft-2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use tanliboy/llama-3.2-3b-sft-2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="tanliboy/llama-3.2-3b-sft-2") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("tanliboy/llama-3.2-3b-sft-2") model = AutoModelForCausalLM.from_pretrained("tanliboy/llama-3.2-3b-sft-2", 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use tanliboy/llama-3.2-3b-sft-2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "tanliboy/llama-3.2-3b-sft-2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "tanliboy/llama-3.2-3b-sft-2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/tanliboy/llama-3.2-3b-sft-2
- SGLang
How to use tanliboy/llama-3.2-3b-sft-2 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 "tanliboy/llama-3.2-3b-sft-2" \ --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": "tanliboy/llama-3.2-3b-sft-2", "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 "tanliboy/llama-3.2-3b-sft-2" \ --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": "tanliboy/llama-3.2-3b-sft-2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use tanliboy/llama-3.2-3b-sft-2 with Docker Model Runner:
docker model run hf.co/tanliboy/llama-3.2-3b-sft-2
|
Download README.md from tanliboy/llama-3.2-3b-sft-2: direct link, hf CLI and curl.
- Browser
- Download file 2.66 kB
-
https://huggingface.co/tanliboy/llama-3.2-3b-sft-2/resolve/main/README.md
- Command line
-
hf download hf://tanliboy/llama-3.2-3b-sft-2/README.md
-
curl -L -o README.md https://huggingface.co/tanliboy/llama-3.2-3b-sft-2/resolve/main/README.md
2.66 kB
metadata
library_name: transformers
license: llama3.2
base_model: tanliboy/llama-3.2-3b
tags:
- alignment-handbook
- trl
- sft
- generated_from_trainer
- trl
- sft
- generated_from_trainer
datasets:
- tanliboy/OpenHermes-2.5-reformat
model-index:
- name: llama-3.2-3b-sft-2
results: []
llama-3.2-3b-sft-2
This model is a fine-tuned version of tanliboy/llama-3.2-3b on the tanliboy/OpenHermes-2.5-reformat dataset. It achieves the following results on the evaluation set:
- Loss: 0.6744
Model description
More information needed
Intended uses & limitations
More information needed
Training and evaluation data
More information needed
Training procedure
Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 5e-06
- train_batch_size: 8
- eval_batch_size: 8
- seed: 42
- distributed_type: multi-GPU
- num_devices: 8
- gradient_accumulation_steps: 2
- total_train_batch_size: 128
- total_eval_batch_size: 64
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: cosine
- lr_scheduler_warmup_steps: 1000
- training_steps: 10000
Training results
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 0.7792 | 0.0673 | 500 | 0.7726 |
| 0.7496 | 0.1345 | 1000 | 0.7444 |
| 0.7243 | 0.2018 | 1500 | 0.7296 |
| 0.7178 | 0.2691 | 2000 | 0.7197 |
| 0.7077 | 0.3363 | 2500 | 0.7127 |
| 0.6992 | 0.4036 | 3000 | 0.7066 |
| 0.6992 | 0.4708 | 3500 | 0.7012 |
| 0.6945 | 0.5381 | 4000 | 0.6965 |
| 0.6879 | 0.6054 | 4500 | 0.6920 |
| 0.6901 | 0.6726 | 5000 | 0.6879 |
| 0.6759 | 0.7399 | 5500 | 0.6844 |
| 0.6752 | 0.8072 | 6000 | 0.6812 |
| 0.6826 | 0.8744 | 6500 | 0.6783 |
| 0.6804 | 0.9417 | 7000 | 0.6758 |
| 0.6131 | 1.0089 | 7500 | 0.6764 |
| 0.6012 | 1.0762 | 8000 | 0.6758 |
| 0.6136 | 1.1435 | 8500 | 0.6751 |
| 0.6127 | 1.2107 | 9000 | 0.6747 |
| 0.6076 | 1.2780 | 9500 | 0.6745 |
| 0.6033 | 1.3453 | 10000 | 0.6744 |
Framework versions
- Transformers 4.44.2
- Pytorch 2.4.0+cu121
- Datasets 2.19.1
- Tokenizers 0.19.1