Text Generation
Transformers
PyTorch
TensorBoard
Safetensors
llama
axolotl
Generated from Trainer
conversational
text-generation-inference
Instructions to use vijil/llama3-8b-instruct-consistent_sft-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use vijil/llama3-8b-instruct-consistent_sft-v2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="vijil/llama3-8b-instruct-consistent_sft-v2") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("vijil/llama3-8b-instruct-consistent_sft-v2") model = AutoModelForCausalLM.from_pretrained("vijil/llama3-8b-instruct-consistent_sft-v2", 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 vijil/llama3-8b-instruct-consistent_sft-v2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "vijil/llama3-8b-instruct-consistent_sft-v2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "vijil/llama3-8b-instruct-consistent_sft-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/vijil/llama3-8b-instruct-consistent_sft-v2
- SGLang
How to use vijil/llama3-8b-instruct-consistent_sft-v2 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 "vijil/llama3-8b-instruct-consistent_sft-v2" \ --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": "vijil/llama3-8b-instruct-consistent_sft-v2", "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 "vijil/llama3-8b-instruct-consistent_sft-v2" \ --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": "vijil/llama3-8b-instruct-consistent_sft-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use vijil/llama3-8b-instruct-consistent_sft-v2 with Docker Model Runner:
docker model run hf.co/vijil/llama3-8b-instruct-consistent_sft-v2
See axolotl config
axolotl version: 0.4.0
base_model: meta-llama/Meta-Llama-3-8B-Instruct
model_type: LlamaForCausalLM
tokenizer_type: AutoTokenizer
load_in_8bit: false
load_in_4bit: false
strict: false
datasets:
- path: ./my_data/consistency_finetune-data-v2-axolotl_fft.jsonl
type: alpaca
dataset_prepared_path: last_run_prepared
val_set_size: 0.05
eval_sample_packing: False
output_dir: ./consistency_finetune-data-v2-axolotl_fft
hub_model_id: vijil/llama3-8b-instruct-consistent_sft-v2
sequence_len: 8192
sample_packing: true
pad_to_sequence_len: true
wandb_project:
wandb_entity:
wandb_watch:
wandb_name:
wandb_log_model:
gradient_accumulation_steps: 8
micro_batch_size: 1
num_epochs: 4
optimizer: adamw_bnb_8bit
lr_scheduler: cosine
learning_rate: 0.00005
train_on_inputs: false
group_by_length: false
bf16: true
fp16: false
tf32: false
gradient_checkpointing: true
early_stopping_patience:
resume_from_checkpoint:
local_rank:
logging_steps: 1
xformers_attention:
flash_attention: true
flash_attn_cross_entropy: false
flash_attn_rms_norm: true
flash_attn_fuse_qkv: false
flash_attn_fuse_mlp: true
warmup_ratio: 0.02
evals_per_epoch: 2
eval_table_size:
saves_per_epoch: 1
debug:
deepspeed: deepspeed_configs/zero2.json # multi-gpu only
weight_decay: 0.1
adam_beta1: 0.9
adam_beta2: 0.95
adam_epsilon: 0.00000001
max_grad_norm: 1.0
fsdp:
fsdp_config:
special_tokens:
pad_token: <|end_of_text|>
llama3-8b-instruct-consistent_sft-v2
This model is a fine-tuned version of meta-llama/Meta-Llama-3-8B-Instruct on the None dataset. It achieves the following results on the evaluation set:
- Loss: 0.2056
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-05
- train_batch_size: 1
- eval_batch_size: 1
- seed: 42
- distributed_type: multi-GPU
- num_devices: 10
- gradient_accumulation_steps: 8
- total_train_batch_size: 80
- total_eval_batch_size: 10
- optimizer: Adam with betas=(0.9,0.95) and epsilon=1e-08
- lr_scheduler_type: cosine
- num_epochs: 4
Training results
| Training Loss | Epoch | Step | Validation Loss |
|---|---|---|---|
| 3.1682 | 0.09 | 1 | 3.1898 |
| 0.9665 | 0.54 | 6 | 0.8419 |
| 0.4173 | 1.06 | 12 | 0.4193 |
| 0.2811 | 1.6 | 18 | 0.3025 |
| 0.1379 | 2.1 | 24 | 0.2382 |
| 0.1176 | 2.64 | 30 | 0.2314 |
| 0.075 | 3.16 | 36 | 0.2094 |
| 0.066 | 3.7 | 42 | 0.2056 |
Framework versions
- Transformers 4.40.0.dev0
- Pytorch 2.2.1
- Datasets 2.15.0
- Tokenizers 0.15.0
- Downloads last month
- 11
Model tree for vijil/llama3-8b-instruct-consistent_sft-v2
Base model
meta-llama/Meta-Llama-3-8B-Instruct