Downloads · 30 days
23
1% of all-time downloads
mostafaamiri/persian_llama_7B_merged
persian_llama_7B_merged is a text generation model from mostafaamiri. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as bsd.
This model is Llama2-7B fine-tuned model which trained on farsi-wiki(approximately 180 milion token) and translated ALPACA dataset. We extend tokenizer by 19954 new token with BPE algorithm running on persian dataset.
Downloads · 30 days
23
1% of all-time downloads
All-time downloads
2K
Public
Parameters
6.9B
27.6 GB on disk
Likes
10
Public
Click a slice to open those files.
.safetensors27.6 GB · 100%
From the Hugging Face model README
This model is Llama2-7B fine-tuned model which trained on farsi-wiki(approximately 180 milion token) and translated ALPACA dataset. We extend tokenizer by 19954 new token with BPE algorithm running on persian dataset.
Use this code to run model on you input:
from transformers import AutoTokenizer, LlamaModelForCausalLM
model = LlamaModelForCausalLM.from_pretrained("mostafaamiri/persian_llama_7B_merged")
tokenizer = AutoTokenizer.from_pretrained(""mostafaamiri/persian_llama_7B_merged"")
instruction = "برای رفتن به کوهنوردی چه وسایلی را با خود ببرم؟"
prompt = [
"""Below is an instruction that describes a task.
Write a response that appropriately completes the request.\n\n
### Instruction:\n\n{instruction}\n\n\n### Response:\n\n\n"""
]
model.to("cuda")
generated_ids = model.generate(**tokenizer(prompt, return_tensors='pt').to("cuda"))
print(tokenizer.batch_decode(generated_ids)[0])