Downloads · 30 days
0
Abdullah-abushammala/insurance-expert-llama-3b-lora
insurance-expert-llama-3b-lora is a text generation model from Abdullah-abushammala. Use it when you need the model to write or continue text. The card lists the license as apache-2.0.
This model is a fine-tuned version of meta-llama/Llama-3.2-3B using LoRA (Low-Rank Adaptation) specialized for insurance domain expertise.
Downloads · 30 days
0
Access
Public
Updated Aug 16, 2025
Repo size
212 MB
Likes
0
Public
Click a slice to open those files.
.safetensors195 MB · 92%
From the Hugging Face model README
This model is a fine-tuned version of meta-llama/Llama-3.2-3B using LoRA (Low-Rank Adaptation) specialized for insurance domain expertise.
(... rest of your content)
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
import torch
# Load base model and tokenizer
tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-3.2-3B")
base_model = AutoModelForCausalLM.from_pretrained(
"meta-llama/Llama-3.2-3B",
torch_dtype=torch.float16,
device_map="auto"
)
# Load LoRA adapter
model = PeftModel.from_pretrained(base_model, "Abdullah-abushammala/insurance-expert-llama-3b-lora")
model.eval()
def ask_insurance_expert(question):
prompt = f"Question: {question}\\nAnswer:"
inputs = tokenizer(prompt, return_tensors='pt', padding=True)
with torch.no_grad():
outputs = model.generate(
**inputs,
max_length=120,
temperature=0.4,
do_sample=True,
top_p=0.8,
repetition_penalty=1.3,
no_repeat_ngram_size=3,
pad_token_id=tokenizer.eos_token_id,
eos_token_id=tokenizer.eos_token_id
)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
return response.split("Answer:", 1)[1].strip()
# Example usage
answer = ask_insurance_expert("What is a deductible in health insurance?")
print(answer)