cfierro/simpleqa_wiki
Viewer • Updated • 5.15k • 13
How to use cfierro/llama-3.1-8b-fft-simpleqa-raw-wiki 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-raw-wiki")
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-raw-wiki")
model = AutoModelForCausalLM.from_pretrained("cfierro/llama-3.1-8b-fft-simpleqa-raw-wiki", 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]:]))How to use cfierro/llama-3.1-8b-fft-simpleqa-raw-wiki with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "cfierro/llama-3.1-8b-fft-simpleqa-raw-wiki"
# 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-raw-wiki",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/cfierro/llama-3.1-8b-fft-simpleqa-raw-wiki
How to use cfierro/llama-3.1-8b-fft-simpleqa-raw-wiki 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-raw-wiki" \
--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-raw-wiki",
"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-raw-wiki" \
--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-raw-wiki",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use cfierro/llama-3.1-8b-fft-simpleqa-raw-wiki with Docker Model Runner:
docker model run hf.co/cfierro/llama-3.1-8b-fft-simpleqa-raw-wiki
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
type: completion
field: doc
split: test
dataset_prepared_path: /scratch/project/eu-25-39/knowledge-ft/axolotl/datasets/Llama-2-7b-chat/simpleqa-raw-wiki
val_set_size: 0.0
output_dir: /scratch/project/eu-25-39/knowledge-ft/axolotl/models/llama-3.1-8b-fft-simpleqa-raw-wiki
hub_model_id: llama-3.1-8b-fft-simpleqa-raw-wiki
sequence_len: 4096
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-raw-wiki
wandb_log_model: "false"
# Multi-GPU settings (same as AR full-FT)
# effective batch = 4 GPUs * 1 micro_batch * 2 grad_accum = 8
gradient_accumulation_steps: 2
micro_batch_size: 1
max_steps: 500
save_steps: 100
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
save_total_limit: 1
weight_decay: 0.0
special_tokens:
pad_token: <|end_of_text|>
# DeepSpeed ZeRO Stage 3
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 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