Text Generation
Transformers
PyTorch
TensorBoard
Safetensors
llama
axolotl
Generated from Trainer
conversational
text-generation-inference
Instructions to use vijil/llama2-7b-chat-consistent_sft-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use vijil/llama2-7b-chat-consistent_sft-v2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="vijil/llama2-7b-chat-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/llama2-7b-chat-consistent_sft-v2") model = AutoModelForCausalLM.from_pretrained("vijil/llama2-7b-chat-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/llama2-7b-chat-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/llama2-7b-chat-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/llama2-7b-chat-consistent_sft-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/vijil/llama2-7b-chat-consistent_sft-v2
- SGLang
How to use vijil/llama2-7b-chat-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/llama2-7b-chat-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/llama2-7b-chat-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/llama2-7b-chat-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/llama2-7b-chat-consistent_sft-v2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use vijil/llama2-7b-chat-consistent_sft-v2 with Docker Model Runner:
docker model run hf.co/vijil/llama2-7b-chat-consistent_sft-v2
See axolotl config
axolotl version: 0.4.0
base_model: meta-llama/Llama-2-7b-chat-hf
model_type: LlamaForCausalLM
tokenizer_type: LlamaTokenizer
is_llama_derived_model: true
load_in_8bit: false
load_in_4bit: false
strict: false
datasets:
- path: ./my_data/consistency_finetune-data-v2-axolotl_fft.jsonl
type: alpaca
conversation: llama-2
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/llama2-7b-chat-consistent_sft-v2
sequence_len: 4096
sample_packing: true
pad_to_sequence_len: true
adapter:
lora_model_dir:
lora_r:
lora_alpha:
lora_dropout:
lora_target_linear:
lora_fan_in_fan_out:
wandb_project:
wandb_entity:
wandb_watch:
wandb_name:
wandb_log_model:
gradient_accumulation_steps: 1
micro_batch_size: 2
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: 4
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:
bos_token: "<s>"
eos_token: "</s>"
unk_token: "<unk>"
llama2-7b-chat-consistent_sft-v2
This model is a fine-tuned version of meta-llama/Llama-2-7b-chat-hf on the None dataset. It achieves the following results on the evaluation set:
- Loss: 0.1819
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: 2
- eval_batch_size: 2
- seed: 42
- distributed_type: multi-GPU
- num_devices: 10
- total_train_batch_size: 20
- total_eval_batch_size: 20
- 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 |
|---|---|---|---|
| 2.7818 | 0.01 | 1 | 2.0160 |
| 0.8245 | 0.25 | 27 | 0.6509 |
| 0.5218 | 0.5 | 54 | 0.4562 |
| 0.3301 | 0.75 | 81 | 0.3170 |
| 0.3017 | 1.0 | 108 | 0.2716 |
| 0.1213 | 1.21 | 135 | 0.2813 |
| 0.2232 | 1.46 | 162 | 0.2448 |
| 0.1273 | 1.71 | 189 | 0.2131 |
| 0.1354 | 1.96 | 216 | 0.2088 |
| 0.0892 | 2.18 | 243 | 0.2076 |
| 0.0749 | 2.43 | 270 | 0.1822 |
| 0.0653 | 2.68 | 297 | 0.1783 |
| 0.0497 | 2.93 | 324 | 0.1760 |
| 0.0485 | 3.14 | 351 | 0.1788 |
| 0.0144 | 3.39 | 378 | 0.1822 |
| 0.027 | 3.64 | 405 | 0.1821 |
| 0.0223 | 3.89 | 432 | 0.1819 |
Framework versions
- Transformers 4.40.0.dev0
- Pytorch 2.2.1
- Datasets 2.18.0
- Tokenizers 0.15.0
- Downloads last month
- 19
Model tree for vijil/llama2-7b-chat-consistent_sft-v2
Base model
meta-llama/Llama-2-7b-chat-hf