Downloads · 30 days
31
4% of all-time downloads
Hesam760/persian-water-regulations-qwen2.5-1.5b
persian-water-regulations-qwen2.5-1.5b is a text generation model from Hesam760. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
A Persian domain-adapted language model for answering questions about the "Operational By-law and General Conditions of Water and Wastewater Tariffs".
Downloads · 30 days
31
4% of all-time downloads
All-time downloads
795
Public
Parameters
1.5B
3.1 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors3.1 GB · 100%
From the Hugging Face model README
A Persian domain-adapted language model for answering questions about the "Operational By-law and General Conditions of Water and Wastewater Tariffs".
Qwen/Qwen2.5-1.5B-Instruct
all-linearThe automatic metrics measure textual similarity and do not establish legal correctness. Manual review is required for authoritative use.
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "Hesam760/persian-water-regulations-qwen2.5-1.5b"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
device_map="auto",
dtype=torch.float16,
)
messages = [
{
"role": "system",
"content": (
"شما دستیار تخصصی آییننامه عملیاتی و شرایط عمومی تعرفههای "
"آب و فاضلاب هستید. فقط بر اساس مفاد آییننامه پاسخ دهید."
),
},
{
"role": "user",
"content": "هدف آییننامه چیست؟",
},
]
inputs = tokenizer.apply_chat_template(
messages,
tokenize=True,
add_generation_prompt=True,
return_dict=True,
return_tensors="pt",
).to(model.device)
output_ids = model.generate(
**inputs,
max_new_tokens=160,
do_sample=False,
)
new_tokens = output_ids[0, inputs["input_ids"].shape[-1]:]
print(tokenizer.decode(new_tokens, skip_special_tokens=True))