Instructions to use DavoudMo/persian-slm-qa with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use DavoudMo/persian-slm-qa with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-1.7B") model = PeftModel.from_pretrained(base_model, "DavoudMo/persian-slm-qa") - Transformers
How to use DavoudMo/persian-slm-qa with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="DavoudMo/persian-slm-qa") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("DavoudMo/persian-slm-qa", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use DavoudMo/persian-slm-qa with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "DavoudMo/persian-slm-qa" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "DavoudMo/persian-slm-qa", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/DavoudMo/persian-slm-qa
- SGLang
How to use DavoudMo/persian-slm-qa with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "DavoudMo/persian-slm-qa" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "DavoudMo/persian-slm-qa", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "DavoudMo/persian-slm-qa" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "DavoudMo/persian-slm-qa", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use DavoudMo/persian-slm-qa with Docker Model Runner:
docker model run hf.co/DavoudMo/persian-slm-qa
Persian SLM QA (LoRA adapter)
Private LoRA adapter for Persian Q&A, fine-tuned on top of Qwen/Qwen3-1.7B.
This repo contains adapter weights only (~25 MB). Recipients must also download the base model from Hugging Face.
Adapter settings
- PEFT type: LoRA
r: 16lora_alpha: 32lora_dropout: 0.05- Target modules:
q_proj,k_proj,v_proj,o_proj
Load
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base = "Qwen/Qwen3-1.7B"
adapter = "DavoudMo/persian-slm-qa" # private: must be logged in / have access
tokenizer = AutoTokenizer.from_pretrained(adapter, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
base, torch_dtype="auto", device_map="auto", trust_remote_code=True
)
model = PeftModel.from_pretrained(model, adapter)
Private access
- Repo owner adds the collaborator's Hugging Face username under Settings β Collaborators.
- Collaborator runs
hf auth login(or setsHF_TOKEN) with a token that can read this repo. - Then
from_pretrained(adapter)works as usual.
License
Derived from Qwen/Qwen3-1.7B. Follow Qwen's license terms when redistributing or deploying.
- Downloads last month
- 10