Instructions to use zpm/Llama-3.1-PersianQA with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use zpm/Llama-3.1-PersianQA with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("document-question-answering", model="zpm/Llama-3.1-PersianQA")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("zpm/Llama-3.1-PersianQA", dtype="auto") - llama-cpp-python
How to use zpm/Llama-3.1-PersianQA with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="zpm/Llama-3.1-PersianQA", filename="unsloth.F16.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 zpm/Llama-3.1-PersianQA with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf zpm/Llama-3.1-PersianQA:F16 # Run inference directly in the terminal: llama cli -hf zpm/Llama-3.1-PersianQA:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf zpm/Llama-3.1-PersianQA:F16 # Run inference directly in the terminal: llama cli -hf zpm/Llama-3.1-PersianQA:F16
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 zpm/Llama-3.1-PersianQA:F16 # Run inference directly in the terminal: ./llama-cli -hf zpm/Llama-3.1-PersianQA:F16
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 zpm/Llama-3.1-PersianQA:F16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf zpm/Llama-3.1-PersianQA:F16
Use Docker
docker model run hf.co/zpm/Llama-3.1-PersianQA:F16
- LM Studio
- Jan
- Ollama
How to use zpm/Llama-3.1-PersianQA with Ollama:
ollama run hf.co/zpm/Llama-3.1-PersianQA:F16
- Unsloth Studio
How to use zpm/Llama-3.1-PersianQA 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 zpm/Llama-3.1-PersianQA 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 zpm/Llama-3.1-PersianQA to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for zpm/Llama-3.1-PersianQA to start chatting
- Atomic Chat new
- Docker Model Runner
How to use zpm/Llama-3.1-PersianQA with Docker Model Runner:
docker model run hf.co/zpm/Llama-3.1-PersianQA:F16
- Lemonade
How to use zpm/Llama-3.1-PersianQA with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull zpm/Llama-3.1-PersianQA:F16
Run and chat with the model
lemonade run user.Llama-3.1-PersianQA-F16
List all available models
lemonade list
Issue Loading zpm/Llama-3.1-PersianQA Model – Missing pytorch_model.bin File
Hello everyone,
I've been trying to use the zpm/Llama-3.1-PersianQA model for a question-answering task with the following code:
from transformers import pipeline
# Load the model
qa_pipeline = pipeline("question-answering", model="zpm/Llama-3.1-PersianQA")
# Example usage
context = "شرکت فولاد مبارکۀ اصفهان، بزرگترین واحد صنعتی خصوصی در ایران و بزرگترین مجتمع تولید فولاد در خاورمیانه است."
question = "شرکت فولاد مبارکه در کجا واقع شده است؟"
result = qa_pipeline(question=question, context=context)
print(result)
However, I encountered the following error:
OSError: zpm/Llama-3.1-PersianQA does not appear to have a file named pytorch_model.bin, model.safetensors, tf_model.h5, model.ckpt or flax_model.msgpack.
I checked the model repository, and it includes files such as adapter_model.safetensors, config.json, and some .gguf files, but not pytorch_model.bin or other full model files.
I'm wondering if this is an adapter model that needs to be loaded with a specific base model, or if there's another way to use the available adapter_model.safetensors file. I’d appreciate any guidance on how to properly load and use this model or if there’s a base model I should pair it with.
Thanks in advance for any help or suggestions!
دهنت سرویس من یک ساعته دارم تلاش میکنم اجراش کنم مگه اجرا میشه ؟