Downloads · 30 days
6
18% of all-time downloads
Kranthi1290/llama-3.2-3b-support-ticket-json
llama-3.2-3b-support-ticket-json is a text generation model from Kranthi1290. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as llama3.2.
A LoRA fine-tune of meta-llama/Llama-3.2-3B-Instruct that converts free-text customer support messages into structured JSON with category, priority, and summary fields.
Downloads · 30 days
6
18% of all-time downloads
All-time downloads
34
Public
Repo size
53.9 MB
Likes
0
Public
Click a slice to open those files.
.safetensors36.7 MB · 68%
From the Hugging Face model README
A LoRA fine-tune of meta-llama/Llama-3.2-3B-Instruct that
converts free-text customer support messages into structured JSON with category, priority, and summary fields.
Trained on 35 synthetic support-ticket examples using TRL's SFTTrainer with LoRA
(r=16, alpha=32, targeting the attention projection layers). Built with Llama.
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base_model = "meta-llama/Llama-3.2-3B-Instruct"
adapter = "Kranthi1290/llama-3.2-3b-support-ticket-json"
tok = AutoTokenizer.from_pretrained(base_model)
model = AutoModelForCausalLM.from_pretrained(base_model, torch_dtype=torch.bfloat16, device_map="auto")
model = PeftModel.from_pretrained(model, adapter)
messages = [
{"role": "system", "content": "You extract structured info from customer support messages. Respond with ONLY a JSON object with keys: category, priority, summary. No other text."},
{"role": "user", "content": "My login keeps failing after the update, this is urgent, please help asap"},
]
prompt = tok.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tok(prompt, return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=100, do_sample=False)
print(tok.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))