mondk/Jev-Decisions-EN-Vi-Vietnamese
Viewer • Updated • 60k • 150 • 1
It is Gemma, but fine-tuned to resemble TypeSafe/Jev.
Dataset: mondk/Jev-Decisions-EN-Vi-Vietnamese
Note regarding the license: If you publish a model derived from this one, you must use the Gemma license (as required by Google).
pip install transformers accelerate
import torch, json
from transformers import AutoModelForCausalLM, AutoTokenizer
REPO = "mondk/Gemma-1B-Jev-Decision-Classification-SystemOne"
tok = AutoTokenizer.from_pretrained(REPO)
model = AutoModelForCausalLM.from_pretrained(REPO, dtype=torch.float16, device_map="auto")
prompt = (
"Decision task. Output one JSON object, no explanation.\n"
"STATE:\nSupport ticket: I got the wrong item, refund my card please.\n"
'QUESTIONS:\n{"department": {"type": "choice", "instruction": "Which team handles this?", '
'"options": ["general", "sales", "shipping", "billing", "technical"]}, '
'"wants_refund": {"type": "boolean", "instruction": "Wants refund?"}}'
)
txt = tok.apply_chat_template(
[{"role": "user", "content": prompt}],
tokenize=False, add_generation_prompt=True,
)
inp = tok(txt, return_tensors="pt", add_special_tokens=False).to(model.device)
out = model.generate(inp["input_ids"], max_new_tokens=200, do_sample=False)
result = json.loads(tok.decode(out[0][inp["input_ids"].shape[1]:], skip_special_tokens=True).strip())
print(result) # {"department": "shipping", "wants_refund": true}
add_special_tokens=False is mandatory — the tokenizer already includes <bos> in the template; using the default setting results in a double-BOS, causing the model to return an empty output.do_sample=False) — the model was trained using the Jev method, making it suitable only for deterministic outputs rather than free-form chat.json.loads) with no extraneous text.ty
Base model
google/gemma-3-1b-pt