cfierro/simpleqa_wiki_ar_Llama-3.1-8B-Instruct
Viewer • Updated • 23.3k • 6
How to use cfierro/llama-3.1-8b-fft-simpleqa-ar with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="cfierro/llama-3.1-8b-fft-simpleqa-ar")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("cfierro/llama-3.1-8b-fft-simpleqa-ar")
model = AutoModelForCausalLM.from_pretrained("cfierro/llama-3.1-8b-fft-simpleqa-ar")
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]:]))How to use cfierro/llama-3.1-8b-fft-simpleqa-ar with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "cfierro/llama-3.1-8b-fft-simpleqa-ar"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "cfierro/llama-3.1-8b-fft-simpleqa-ar",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/cfierro/llama-3.1-8b-fft-simpleqa-ar
How to use cfierro/llama-3.1-8b-fft-simpleqa-ar with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "cfierro/llama-3.1-8b-fft-simpleqa-ar" \
--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": "cfierro/llama-3.1-8b-fft-simpleqa-ar",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'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 "cfierro/llama-3.1-8b-fft-simpleqa-ar" \
--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": "cfierro/llama-3.1-8b-fft-simpleqa-ar",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use cfierro/llama-3.1-8b-fft-simpleqa-ar with Docker Model Runner:
docker model run hf.co/cfierro/llama-3.1-8b-fft-simpleqa-ar
axolotl version: 0.10.0
base_model: meta-llama/Llama-3.1-8B-Instruct
model_type: LlamaForCausalLM
tokenizer_type: AutoTokenizer
load_in_8bit: false
load_in_4bit: false
datasets:
- path: cfierro/simpleqa_wiki_ar_Llama-3.1-8B-Instruct
type: completion
field: text # also available: field_prompt, field_completion
split: test
dataset_prepared_path: /scratch/project/eu-25-39/knowledge-ft/axolotl/datasets/Llama-2-7b-chat/simpleqa-ar
val_set_size: 0.0
output_dir: /scratch/project/eu-25-39/knowledge-ft/axolotl/models/llama-3.1-8b-fft-simpleqa-ar
hub_model_id: llama-3.1-8b-fft-simpleqa-ar
sequence_len: 4096
# Since most examples are ~600 in length, then each "example" is actually 6-8 examples
# which means that batch_size in reality is batch_size * 6
sample_packing: true
eval_sample_packing: false
# No LoRA — full fine-tuning
wandb_project: knowledge-ft
wandb_entity: cfierro
wandb_watch:
wandb_name: llama-3.1-8b-fft-simpleqa-ar
wandb_log_model: "false"
# Multi-GPU settings
# micro_batch=1 to fit full FT in memory (ZeRO-3 on 4x A100 40GB)
# grad_accum=2 to keep same effective batch size (1 * 2 * 4 GPUs = 8)
gradient_accumulation_steps: 2
micro_batch_size: 1
#num_epochs: 3
max_steps: 3000
optimizer: adamw_bnb_8bit
lr_scheduler: constant
learning_rate: 1e-5
bf16: auto
tf32: false
gradient_checkpointing: true
resume_from_checkpoint:
logging_steps: 1
flash_attention: true
warmup_ratio: 0.03 # Same from SEAL
#eval_steps: 1000
save_steps: 1000
save_total_limit: 1
load_best_model_at_end: true
weight_decay: 0.0
special_tokens:
pad_token: <|end_of_text|>
# DeepSpeed ZeRO Stage 3 - shards model weights, gradients, and optimizer across GPUs
deepspeed: deepspeed_configs/zero3.json
This model is a fine-tuned version of meta-llama/Llama-3.1-8B-Instruct on the cfierro/simpleqa_wiki_ar_Llama-3.1-8B-Instruct dataset.
More information needed
More information needed
More information needed
The following hyperparameters were used during training:
Base model
meta-llama/Llama-3.1-8B