Quantization made by Richard Erkhov. [Github](https://github.com/RichardErkhov) [Discord](https://discord.gg/pvy7H8DZMG) [Request more models](https://github.com/RichardErkhov/quant_request) PersianLLaMA-13B-Instruct - GGUF - Model creator: https://huggingface.co/ViraIntelligentDataMining/ - Original model: https://huggingface.co/ViraIntelligentDataMining/PersianLLaMA-13B-Instruct/ | Name | Quant method | Size | | ---- | ---- | ---- | | [PersianLLaMA-13B-Instruct.Q2_K.gguf](https://huggingface.co/RichardErkhov/ViraIntelligentDataMining_-_PersianLLaMA-13B-Instruct-gguf/blob/main/PersianLLaMA-13B-Instruct.Q2_K.gguf) | Q2_K | 4.68GB | | [PersianLLaMA-13B-Instruct.IQ3_XS.gguf](https://huggingface.co/RichardErkhov/ViraIntelligentDataMining_-_PersianLLaMA-13B-Instruct-gguf/blob/main/PersianLLaMA-13B-Instruct.IQ3_XS.gguf) | IQ3_XS | 5.17GB | | [PersianLLaMA-13B-Instruct.IQ3_S.gguf](https://huggingface.co/RichardErkhov/ViraIntelligentDataMining_-_PersianLLaMA-13B-Instruct-gguf/blob/main/PersianLLaMA-13B-Instruct.IQ3_S.gguf) | IQ3_S | 5.45GB | | [PersianLLaMA-13B-Instruct.Q3_K_S.gguf](https://huggingface.co/RichardErkhov/ViraIntelligentDataMining_-_PersianLLaMA-13B-Instruct-gguf/blob/main/PersianLLaMA-13B-Instruct.Q3_K_S.gguf) | Q3_K_S | 5.45GB | | [PersianLLaMA-13B-Instruct.IQ3_M.gguf](https://huggingface.co/RichardErkhov/ViraIntelligentDataMining_-_PersianLLaMA-13B-Instruct-gguf/blob/main/PersianLLaMA-13B-Instruct.IQ3_M.gguf) | IQ3_M | 5.75GB | | [PersianLLaMA-13B-Instruct.Q3_K.gguf](https://huggingface.co/RichardErkhov/ViraIntelligentDataMining_-_PersianLLaMA-13B-Instruct-gguf/blob/main/PersianLLaMA-13B-Instruct.Q3_K.gguf) | Q3_K | 6.08GB | | [PersianLLaMA-13B-Instruct.Q3_K_M.gguf](https://huggingface.co/RichardErkhov/ViraIntelligentDataMining_-_PersianLLaMA-13B-Instruct-gguf/blob/main/PersianLLaMA-13B-Instruct.Q3_K_M.gguf) | Q3_K_M | 6.08GB | | [PersianLLaMA-13B-Instruct.Q3_K_L.gguf](https://huggingface.co/RichardErkhov/ViraIntelligentDataMining_-_PersianLLaMA-13B-Instruct-gguf/blob/main/PersianLLaMA-13B-Instruct.Q3_K_L.gguf) | Q3_K_L | 6.63GB | | [PersianLLaMA-13B-Instruct.IQ4_XS.gguf](https://huggingface.co/RichardErkhov/ViraIntelligentDataMining_-_PersianLLaMA-13B-Instruct-gguf/blob/main/PersianLLaMA-13B-Instruct.IQ4_XS.gguf) | IQ4_XS | 6.73GB | | [PersianLLaMA-13B-Instruct.Q4_0.gguf](https://huggingface.co/RichardErkhov/ViraIntelligentDataMining_-_PersianLLaMA-13B-Instruct-gguf/blob/main/PersianLLaMA-13B-Instruct.Q4_0.gguf) | Q4_0 | 7.06GB | | [PersianLLaMA-13B-Instruct.IQ4_NL.gguf](https://huggingface.co/RichardErkhov/ViraIntelligentDataMining_-_PersianLLaMA-13B-Instruct-gguf/blob/main/PersianLLaMA-13B-Instruct.IQ4_NL.gguf) | IQ4_NL | 7.1GB | | [PersianLLaMA-13B-Instruct.Q4_K_S.gguf](https://huggingface.co/RichardErkhov/ViraIntelligentDataMining_-_PersianLLaMA-13B-Instruct-gguf/blob/main/PersianLLaMA-13B-Instruct.Q4_K_S.gguf) | Q4_K_S | 7.11GB | | [PersianLLaMA-13B-Instruct.Q4_K.gguf](https://huggingface.co/RichardErkhov/ViraIntelligentDataMining_-_PersianLLaMA-13B-Instruct-gguf/blob/main/PersianLLaMA-13B-Instruct.Q4_K.gguf) | Q4_K | 7.52GB | | [PersianLLaMA-13B-Instruct.Q4_K_M.gguf](https://huggingface.co/RichardErkhov/ViraIntelligentDataMining_-_PersianLLaMA-13B-Instruct-gguf/blob/main/PersianLLaMA-13B-Instruct.Q4_K_M.gguf) | Q4_K_M | 7.52GB | | [PersianLLaMA-13B-Instruct.Q4_1.gguf](https://huggingface.co/RichardErkhov/ViraIntelligentDataMining_-_PersianLLaMA-13B-Instruct-gguf/blob/main/PersianLLaMA-13B-Instruct.Q4_1.gguf) | Q4_1 | 7.81GB | | [PersianLLaMA-13B-Instruct.Q5_0.gguf](https://huggingface.co/RichardErkhov/ViraIntelligentDataMining_-_PersianLLaMA-13B-Instruct-gguf/blob/main/PersianLLaMA-13B-Instruct.Q5_0.gguf) | Q5_0 | 8.57GB | | [PersianLLaMA-13B-Instruct.Q5_K_S.gguf](https://huggingface.co/RichardErkhov/ViraIntelligentDataMining_-_PersianLLaMA-13B-Instruct-gguf/blob/main/PersianLLaMA-13B-Instruct.Q5_K_S.gguf) | Q5_K_S | 8.57GB | | [PersianLLaMA-13B-Instruct.Q5_K.gguf](https://huggingface.co/RichardErkhov/ViraIntelligentDataMining_-_PersianLLaMA-13B-Instruct-gguf/blob/main/PersianLLaMA-13B-Instruct.Q5_K.gguf) | Q5_K | 8.81GB | | [PersianLLaMA-13B-Instruct.Q5_K_M.gguf](https://huggingface.co/RichardErkhov/ViraIntelligentDataMining_-_PersianLLaMA-13B-Instruct-gguf/blob/main/PersianLLaMA-13B-Instruct.Q5_K_M.gguf) | Q5_K_M | 8.81GB | | [PersianLLaMA-13B-Instruct.Q5_1.gguf](https://huggingface.co/RichardErkhov/ViraIntelligentDataMining_-_PersianLLaMA-13B-Instruct-gguf/blob/main/PersianLLaMA-13B-Instruct.Q5_1.gguf) | Q5_1 | 9.33GB | | [PersianLLaMA-13B-Instruct.Q6_K.gguf](https://huggingface.co/RichardErkhov/ViraIntelligentDataMining_-_PersianLLaMA-13B-Instruct-gguf/blob/main/PersianLLaMA-13B-Instruct.Q6_K.gguf) | Q6_K | 10.18GB | | [PersianLLaMA-13B-Instruct.Q8_0.gguf](https://huggingface.co/RichardErkhov/ViraIntelligentDataMining_-_PersianLLaMA-13B-Instruct-gguf/blob/main/PersianLLaMA-13B-Instruct.Q8_0.gguf) | Q8_0 | 13.18GB | Original model description: --- license: cc-by-nc-4.0 language: - fa library_name: transformers tags: - text-generation-inference inference: false pipeline_tag: text-generation datasets: - sinarashidi/alpaca-persian --- # PersianLLaMA: Towards Building First Persian Large Language Model PersianLLaMA ## 🌟 Introduction Welcome to the home of PersianLLaMA, a large language model specifically designed for instruct tasks in the Persian language. With 13 billion parameters, this model is fine-tuned using the Persian Alpaca dataset to excel at executing detailed instructions and delivering tailored outputs. ## 🛠 Model Description The PersianLLaMA model is specifically designed for inference tasks, allowing it to execute detailed instructions and provide outputs tailored to specific requirements. This model has been collaboratively developed by a team of experts, including Mohammad Amin Abbasi, Arash Ghafouri, Mahdi Firouzmandi, Hassan Naderi, Behrouz Minaei Bidgoli. ## 🚀 Quick Start To integrate PersianLLaMA into your project, follow these steps: ```python import torch from transformers import LlamaTokenizer, LlamaForCausalLM prompt_input = ( "Below is an instruction that describes a task. " "Write a response that appropriately completes the request.\n\n" "### Instruction:\n\n{instruction}\n\n### Response:\n\n" ) load_type = torch.float16 device = torch.device(0) def generate_prompt(instruction, input=None): if input: instruction = instruction + '\n' + input return prompt_input.format_map({'instruction': instruction}) model_path = "ViraIntelligentDataMining/PersianLLaMA-13B-Instruct" tokenizer = LlamaTokenizer.from_pretrained(model_path) base_model = LlamaForCausalLM.from_pretrained( model_path, torch_dtype=load_type, device_map='auto', ).cuda() model_vocab_size = base_model.get_input_embeddings().weight.size(0) tokenizer_vocab_size = len(tokenizer) if model_vocab_size != tokenizer_vocab_size: base_model.resize_token_embeddings(tokenizer_vocab_size) def generate_answer(base_model, instruction, input=None): generation_config = dict( temperature=0.5, top_k=40, top_p=0.9, repetition_penalty=1.1, max_new_tokens=1024) input_text = generate_prompt(instruction, input) inputs = tokenizer(input_text, return_tensors="pt") generation_output = base_model.generate( input_ids=inputs["input_ids"].to(device), eos_token_id=tokenizer.eos_token_id, pad_token_id=tokenizer.pad_token_id, **generation_config) s = generation_output[0] output = tokenizer.decode(s, skip_special_tokens=True) response = output.split("### Response:")[1].strip() return response instruction = "تصور کنید در حال نوشتن داستانی درباره یک شهر که تمام ساکنانش ربات هستند. این ربات‌ها توانایی‌های ویژه‌ای دارند که زندگی روزمره آن‌ها را از انسان‌ها متمایز می‌کند. شرح دهید که این ربات‌ها چگونه به کارهای روزانه خود می‌پردازند و چه چالش‌هایی با آن‌ها روبه‌رو هستند. همچنین، توضیح دهید که چگونه معماری شهر برای نیازهای خاص آن‌ها طراحی شده است." response = generate_answer(base_model, instruction=instruction, input="") print(response) """ در این شهر، همه ساکنان ربات هستند که دارای توانایی های منحصر به فرد هستند که زندگی روزمره آنها را از انسان ها متمایز می کند. هر روز صبح، ربات ها بیدار می شوند و برنامه های خود را برای روز تنظیم می کنند. برخی از آنها ممکن است برای کار بروند، در حالی که دیگران ممکن است برای انجام وظایف خانگی یا مراقبت از خانواده خود وقت صرف کنند. ربات ها بسیار کارآمد هستند و می توانند چندین کار را همزمان انجام دهند، بنابراین زمان زیادی برای استراحت ندارند. آنها همچنین به طور منظم برای نگهداری و تعمیر نیاز دارند، زیرا آنها مانند انسان ها مستعد خرابی هستند. بسیاری از ربات ها به دنبال سرگرمی هستند و ممکن است برای شرکت در فعالیت هایی مانند ورزش، خواندن یا نقاشی وقت صرف کنند. برخی از ربات ها حتی ممکن است برای یادگیری یا بهبود مهارت های خود در زمینه های مختلف مانند هنر، موسیقی یا آشپزی تلاش کنند. ربات ها همچنین به طور مداوم به پیشرفت های تکنولوژیکی جدید علاقه مند هستند و اغلب به دنبال راه حل های جدید برای مشکلات موجود در جامعه هستند. در این شهر، همه ساکنان ربات هستند که دارای توانایی های منحصر به فرد هستند که زندگی روزمره آنها را از انسان ها متمایز می کند. """ ``` ## 📈 Evaluation and Benchmarks PersianLLaMA demonstrates superior performance over existing models, with robust evaluation metrics that highlight its capabilities in natural language understanding and generation. ## 📜 Citing PersianLLaMA If you find PersianLLaMA useful in your research, please consider citing: ```bibtex @article{abbasi2023persianllama, title={PersianLLaMA: Towards Building First Persian Large Language Model}, author={Abbasi, Mohammad Amin and others}, journal={https://arxiv.org/abs/2312.15713}, year={2023} } ``` ## 📄 License PersianLLaMA is open-sourced under the CC BY-NC 4.0 license.