Downloads · 30 days
9
26% of all-time downloads
doupari/Llama-3.1-8B-Instruct-question
Llama-3.1-8B-Instruct-question is a text generation model from doupari. Use it when you need the model to write or continue text. It is set up for peft.
This repository contains a LoRA adapter fine-tuned from meta-llama/Llama-3.1-8B-Instruct.
Downloads · 30 days
9
26% of all-time downloads
All-time downloads
34
Public
Repo size
185 MB
Likes
0
Public
Click a slice to open those files.
.safetensors168 MB · 91%
From the Hugging Face model README
This repository contains a LoRA adapter fine-tuned from meta-llama/Llama-3.1-8B-Instruct.
The uploaded adapter was selected from:
checkpoint-2802802.0eval_loss0.0648028627038002Evaluation loss history from training:
| Step | Epoch | Eval loss |
|---|---|---|
| 140 | 1.0 | 0.072911650 |
| 280 | 2.0 | 0.064802863 |
| 420 | 3.0 | 0.077800997 |
| 560 | 4.0 | 0.091106474 |
| 700 | 5.0 | 0.114740528 |
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base_model = "meta-llama/Llama-3.1-8B-Instruct"
adapter_id = "YOUR_USERNAME/YOUR_REPO_NAME"
tokenizer = AutoTokenizer.from_pretrained(adapter_id)
model = AutoModelForCausalLM.from_pretrained(
base_model,
device_map="auto",
torch_dtype="auto",
)
model = PeftModel.from_pretrained(model, adapter_id)
messages = [{"role": "user", "content": "Your question here"}]
inputs = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
return_tensors="pt",
).to(model.device)
outputs = model.generate(inputs, max_new_tokens=256)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))