0bd9bfa070b1cfa70d831b2b1c5d69f3d041cf6c
Model: mostafaamiri/persian_llama_7B_merged Source: Original Platform
license, datasets, language, metrics, pipeline_tag
| license | datasets | language | metrics | pipeline_tag | |||
|---|---|---|---|---|---|---|---|
| bsd |
|
|
|
text-generation |
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])
Description