Downloads · 30 days
5
0% of all-time downloads
amir-ma71/Dorna-Llama3-8B-Instruct-AWQ
Dorna-Llama3-8B-Instruct-AWQ is a text generation model from amir-ma71. Use it when you need the model to write or continue text. It is set up for transformers.
First of all, we would like to express our gratitude to PartAI for their efforts in expanding large language models in the Persian language by releasing the "Dorna" model.
Downloads · 30 days
5
0% of all-time downloads
All-time downloads
5.1K
Public
Parameters
8B
5.7 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors5.7 GB · 100%
How the weights are stored.
I327B · 87%
From the Hugging Face model README
First of all, we would like to express our gratitude to PartAI for their efforts in expanding large language models in the Persian language by releasing the "Dorna" model.
The quantized version of the "Dorna" language model requires only 6GB of GPU memory for loading, while the original model requires 40GB of GPU memory.
This model based on AWQ quantize method that decrease the volume of model in minimum decrease of Accuracy by changing type of weights
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("amir-ma71/Dorna-Llama3-8B-Instruct-AWQ")
model = AutoModelForCausalLM.from_pretrained(
"amir-ma71/Dorna-Llama3-8B-Instruct-AWQ",
torch_dtype=torch.bfloat16,
device_map="cuda",
)
messages = [
{"role": "system",
"content": "You are a helpful Persian assistant. Please answer questions in the asked language."},
{"role": "user", "content": "پایتخت ایران کجاست؟"},
]
input_ids = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
return_tensors="pt"
).to(model.device)
terminators = [
tokenizer.eos_token_id,
tokenizer.convert_tokens_to_ids("<|eot_id|>")
]
outputs = model.generate(
input_ids,
max_new_tokens=256,
eos_token_id=terminators,
do_sample=True,
temperature=0.6,
top_p=0.9,
)
response = outputs[0][input_ids.shape[-1]:]
print(tokenizer.decode(response, skip_special_tokens=True))
پایتخت ایران، تهران است. تهران شهر بزرگ و مهمی در مرکز ایران است که جمعیت قابل توجهی دارد و از مهمترین شهرهای این کشور است.
feel free to contact me:
email: [email protected]