Text Generation
Transformers
PyTorch
TensorBoard
Safetensors
llama
axolotl
Generated from Trainer
conversational
text-generation-inference
Instructions to use vijil/llama2-7b-chat-consistent_sft-v1.1 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-v1.1 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-v1.1") 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-v1.1") model = AutoModelForCausalLM.from_pretrained("vijil/llama2-7b-chat-consistent_sft-v1.1", 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-v1.1 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-v1.1" # 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-v1.1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/vijil/llama2-7b-chat-consistent_sft-v1.1
- SGLang
How to use vijil/llama2-7b-chat-consistent_sft-v1.1 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-v1.1" \ --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-v1.1", "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-v1.1" \ --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-v1.1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use vijil/llama2-7b-chat-consistent_sft-v1.1 with Docker Model Runner:
docker model run hf.co/vijil/llama2-7b-chat-consistent_sft-v1.1
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-v1-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-v1-axolotl_fft
hub_model_id: vijil/llama2-7b-chat-consistent_sft-v1.1
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-v1.1
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.9621
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 |
|---|---|---|---|
| 1.8096 | 0.25 | 1 | 1.1317 |
| 1.2576 | 0.5 | 2 | 0.9342 |
| 0.9792 | 0.75 | 3 | 0.9111 |
| 0.8736 | 1.0 | 4 | 0.9174 |
| 0.7784 | 1.25 | 5 | 0.8739 |
| 0.5671 | 1.25 | 6 | 0.8631 |
| 0.4588 | 1.5 | 7 | 0.8718 |
| 0.4189 | 1.75 | 8 | 0.8929 |
| 0.3971 | 2.0 | 9 | 0.9057 |
| 0.3623 | 2.25 | 10 | 0.9184 |
| 0.2662 | 2.25 | 11 | 0.9316 |
| 0.2426 | 2.5 | 12 | 0.9455 |
| 0.2223 | 2.75 | 13 | 0.9579 |
| 0.2277 | 3.0 | 14 | 0.9619 |
| 0.2261 | 3.25 | 15 | 0.9616 |
| 0.2022 | 3.25 | 16 | 0.9621 |
Framework versions
- Transformers 4.40.0.dev0
- Pytorch 2.2.1
- Datasets 2.18.0
- Tokenizers 0.15.0
- Downloads last month
- 12
Model tree for vijil/llama2-7b-chat-consistent_sft-v1.1
Base model
meta-llama/Llama-2-7b-chat-hf