Downloads · 30 days
0
ReinoutW/perspectief-llama-3-8b-dutch-qa-lora-v1
perspectief-llama-3-8b-dutch-qa-lora-v1 is a machine learning model from ReinoutW. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
basemodel: unsloth/meta-llama-3.1-8b-instruct-bnb-4bit
Downloads · 30 days
0
Access
Public
Updated May 24, 2025
Repo size
2.8 GB
Likes
0
Public
Click a slice to open those files.
.safetensors2.8 GB · 99%
From the Hugging Face model README
base_model: unsloth/meta-llama-3.1-8b-instruct-bnb-4bit
A parameter-efficient LoRA adapter that turns Meta-Llama-3.1-8B-Instruct into a Dutch‑centric, context‑aware assistant for questions about Perspectief (occupational health, safety and absenteeism services).
The adapter was trained on ≈ 400 Q/A rows automatically extracted from perspectief and formatted as:
<|user|>
{Question}
Context:
{DetailedContext}
<|assistant|>
{Answer}<|end|>
Its main purpose is to be used in a Retrieval‑Augmented Generation (RAG) pipeline together with a FAISS knowledge base built from the same source material.
| Developed by | Perspectief LLM demo team |
| Model type | Causal LM adapter (LoRA, r = 64, α = 16) |
| Languages | Dutch (primary) + English instructions |
| License | Proprietary — internal use only; redistribution or commercial use by third parties is forbidden |
| Finetuned from | meta-llama/Meta-Llama-3.1-8B-Instruct |
Content reflects websites as of May 2025; anything outside that scope may be outdated or wrong. Always display the retrieved passage so users can verify.
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
BASE = "meta-llama/Meta-Llama-3.1-8B-Instruct"
ADAPT = "checkpoints/perspectief-llama3" # adapter folder
tok = AutoTokenizer.from_pretrained(BASE, use_fast=True)
tok.add_special_tokens({"additional_special_tokens": ["<|user|>","<|assistant|>","<|end|>"]})
base = AutoModelForCausalLM.from_pretrained(BASE, device_map="auto")
model = PeftModel.from_pretrained(base, ADAPT)
prompt = """<|user|>\nWat kost een extra collega bij de 4‑uur durende training?\n\nContext:\nThe €595 fee applies to each primary participant…\n<|assistant|>\n"""
print(tok.decode(model.generate(**tok(prompt, return_tensors="pt").to(model.device),
max_new_tokens=128)[0]))
| Hyper‑parameter | Value |
|---|---|
| Epochs | 6 |
| Effective batch | 8 (physical 2 × grad‑acc 4) |
| Learning rate | 2 × 10⁻⁵ (cosine decay, 10 % warm‑up) |
| Precision | bf16 compute • 4‑bit NF4 weights |
| Optimiser | paged_adamw_8bit |
| Compute | 1 × RTX 4090 24 GB (≈ 25 min) |
Training data: perspectief_dataset‑1.jsonl (417 rows).
Manual review on 20 held‑out questions shows ≥ 95 % exact‑match when combined with the FAISS retriever.
Open an issue in the GitHub repo for questions or feedback.