Instructions to use RichardErkhov/ViraIntelligentDataMining_-_PersianLLaMA-13B-Instruct-gguf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use RichardErkhov/ViraIntelligentDataMining_-_PersianLLaMA-13B-Instruct-gguf with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="RichardErkhov/ViraIntelligentDataMining_-_PersianLLaMA-13B-Instruct-gguf", filename="PersianLLaMA-13B-Instruct.IQ3_M.gguf", )
output = llm( "Once upon a time,", max_tokens=512, echo=True ) print(output)
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use RichardErkhov/ViraIntelligentDataMining_-_PersianLLaMA-13B-Instruct-gguf with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf RichardErkhov/ViraIntelligentDataMining_-_PersianLLaMA-13B-Instruct-gguf:Q4_K_M # Run inference directly in the terminal: llama-cli -hf RichardErkhov/ViraIntelligentDataMining_-_PersianLLaMA-13B-Instruct-gguf:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf RichardErkhov/ViraIntelligentDataMining_-_PersianLLaMA-13B-Instruct-gguf:Q4_K_M # Run inference directly in the terminal: llama-cli -hf RichardErkhov/ViraIntelligentDataMining_-_PersianLLaMA-13B-Instruct-gguf:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf RichardErkhov/ViraIntelligentDataMining_-_PersianLLaMA-13B-Instruct-gguf:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf RichardErkhov/ViraIntelligentDataMining_-_PersianLLaMA-13B-Instruct-gguf:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf RichardErkhov/ViraIntelligentDataMining_-_PersianLLaMA-13B-Instruct-gguf:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf RichardErkhov/ViraIntelligentDataMining_-_PersianLLaMA-13B-Instruct-gguf:Q4_K_M
Use Docker
docker model run hf.co/RichardErkhov/ViraIntelligentDataMining_-_PersianLLaMA-13B-Instruct-gguf:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use RichardErkhov/ViraIntelligentDataMining_-_PersianLLaMA-13B-Instruct-gguf with Ollama:
ollama run hf.co/RichardErkhov/ViraIntelligentDataMining_-_PersianLLaMA-13B-Instruct-gguf:Q4_K_M
- Unsloth Studio
How to use RichardErkhov/ViraIntelligentDataMining_-_PersianLLaMA-13B-Instruct-gguf with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for RichardErkhov/ViraIntelligentDataMining_-_PersianLLaMA-13B-Instruct-gguf to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for RichardErkhov/ViraIntelligentDataMining_-_PersianLLaMA-13B-Instruct-gguf to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for RichardErkhov/ViraIntelligentDataMining_-_PersianLLaMA-13B-Instruct-gguf to start chatting
- Docker Model Runner
How to use RichardErkhov/ViraIntelligentDataMining_-_PersianLLaMA-13B-Instruct-gguf with Docker Model Runner:
docker model run hf.co/RichardErkhov/ViraIntelligentDataMining_-_PersianLLaMA-13B-Instruct-gguf:Q4_K_M
- Lemonade
How to use RichardErkhov/ViraIntelligentDataMining_-_PersianLLaMA-13B-Instruct-gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull RichardErkhov/ViraIntelligentDataMining_-_PersianLLaMA-13B-Instruct-gguf:Q4_K_M
Run and chat with the model
lemonade run user.ViraIntelligentDataMining_-_PersianLLaMA-13B-Instruct-gguf-Q4_K_M
List all available models
lemonade list
YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
Quantization made by Richard Erkhov.
PersianLLaMA-13B-Instruct - GGUF
- Model creator: https://huggingface.co/ViraIntelligentDataMining/
- Original model: https://huggingface.co/ViraIntelligentDataMining/PersianLLaMA-13B-Instruct/
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
🌟 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:
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:
@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.
- Downloads last month
- 314
2-bit
3-bit
4-bit
5-bit
6-bit
8-bit