Instructions to use nazimali/Mistral-Nemo-Kurdish-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nazimali/Mistral-Nemo-Kurdish-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="nazimali/Mistral-Nemo-Kurdish-Instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("nazimali/Mistral-Nemo-Kurdish-Instruct") model = AutoModelForCausalLM.from_pretrained("nazimali/Mistral-Nemo-Kurdish-Instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - llama-cpp-python
How to use nazimali/Mistral-Nemo-Kurdish-Instruct with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="nazimali/Mistral-Nemo-Kurdish-Instruct", filename="BF16.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use nazimali/Mistral-Nemo-Kurdish-Instruct with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf nazimali/Mistral-Nemo-Kurdish-Instruct:Q4_K_M # Run inference directly in the terminal: llama-cli -hf nazimali/Mistral-Nemo-Kurdish-Instruct:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf nazimali/Mistral-Nemo-Kurdish-Instruct:Q4_K_M # Run inference directly in the terminal: llama-cli -hf nazimali/Mistral-Nemo-Kurdish-Instruct: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 nazimali/Mistral-Nemo-Kurdish-Instruct:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf nazimali/Mistral-Nemo-Kurdish-Instruct: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 nazimali/Mistral-Nemo-Kurdish-Instruct:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf nazimali/Mistral-Nemo-Kurdish-Instruct:Q4_K_M
Use Docker
docker model run hf.co/nazimali/Mistral-Nemo-Kurdish-Instruct:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use nazimali/Mistral-Nemo-Kurdish-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "nazimali/Mistral-Nemo-Kurdish-Instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nazimali/Mistral-Nemo-Kurdish-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/nazimali/Mistral-Nemo-Kurdish-Instruct:Q4_K_M
- SGLang
How to use nazimali/Mistral-Nemo-Kurdish-Instruct 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 "nazimali/Mistral-Nemo-Kurdish-Instruct" \ --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": "nazimali/Mistral-Nemo-Kurdish-Instruct", "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 "nazimali/Mistral-Nemo-Kurdish-Instruct" \ --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": "nazimali/Mistral-Nemo-Kurdish-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use nazimali/Mistral-Nemo-Kurdish-Instruct with Ollama:
ollama run hf.co/nazimali/Mistral-Nemo-Kurdish-Instruct:Q4_K_M
- Unsloth Studio new
How to use nazimali/Mistral-Nemo-Kurdish-Instruct 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 nazimali/Mistral-Nemo-Kurdish-Instruct 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 nazimali/Mistral-Nemo-Kurdish-Instruct to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for nazimali/Mistral-Nemo-Kurdish-Instruct to start chatting
- Pi new
How to use nazimali/Mistral-Nemo-Kurdish-Instruct with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf nazimali/Mistral-Nemo-Kurdish-Instruct:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "nazimali/Mistral-Nemo-Kurdish-Instruct:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use nazimali/Mistral-Nemo-Kurdish-Instruct with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf nazimali/Mistral-Nemo-Kurdish-Instruct:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default nazimali/Mistral-Nemo-Kurdish-Instruct:Q4_K_M
Run Hermes
hermes
- Docker Model Runner
How to use nazimali/Mistral-Nemo-Kurdish-Instruct with Docker Model Runner:
docker model run hf.co/nazimali/Mistral-Nemo-Kurdish-Instruct:Q4_K_M
- Lemonade
How to use nazimali/Mistral-Nemo-Kurdish-Instruct with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull nazimali/Mistral-Nemo-Kurdish-Instruct:Q4_K_M
Run and chat with the model
lemonade run user.Mistral-Nemo-Kurdish-Instruct-Q4_K_M
List all available models
lemonade list
Install from WinGet (Windows)
winget install llama.cpp
# Start a local OpenAI-compatible server with a web UI:
llama-server -hf nazimali/Mistral-Nemo-Kurdish-Instruct:# Run inference directly in the terminal:
llama-cli -hf nazimali/Mistral-Nemo-Kurdish-Instruct: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 nazimali/Mistral-Nemo-Kurdish-Instruct:# Run inference directly in the terminal:
./llama-cli -hf nazimali/Mistral-Nemo-Kurdish-Instruct: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 nazimali/Mistral-Nemo-Kurdish-Instruct:# Run inference directly in the terminal:
./build/bin/llama-cli -hf nazimali/Mistral-Nemo-Kurdish-Instruct:Use Docker
docker model run hf.co/nazimali/Mistral-Nemo-Kurdish-Instruct:سەیری ڕێکخستنی ڕاهێنانی فرە GPU دەکات بۆیە پێویست ناکات بە درێژایی ڕۆژ چاوەڕێی ئەنجامەکان بکەیت. دەتەوێت بە هەردوو ڕێنووسی عەرەبی کرمانجی و سۆرانی ڕاهێنانی پێبکەیت.
نموونەی دیمۆی بۆشاییەکان تاقی بکەرەوە.
This is a 12B parameter model, finetuned on nazimali/Mistral-Nemo-Kurdish for a single Kurdish (Kurmanji) instruction dataset. My intention was to train this with both Kurdish Kurmanji Latin script and Kurdish Sorani Arabic script, but training time was much longer than anticipated.
So I decided to use 1 full Kurdish Kurmanji dataset to get started.
Will look into a multi-GPU training setup so don't have to wait all day for results. Want to train it with both Kurmanji and Sorani Arabic script.
Try spaces demo example.
Example usage
llama-cpp-python
from llama_cpp import Llama
inference_prompt = """Li jêr rêwerzek heye ku peywirek rave dike, bi têketinek ku çarçoveyek din peyda dike ve tê hev kirin. Bersivek ku daxwazê bi guncan temam dike binivîsin.
### Telîmat:
{}
### Têketin:
{}
### Bersiv:
"""
llm = Llama.from_pretrained(
repo_id="nazimali/Mistral-Nemo-Kurdish-Instruct",
filename="Q4_K_M.gguf",
)
llm.create_chat_completion(
messages = [
{
"role": "user",
"content": inference_prompt.format("سڵاو ئەلیکوم، چۆنیت؟")
}
]
)
llama.cpp
./llama-cli \
--hf-repo "nazimali/Mistral-Nemo-Kurdish-Instruct" \
--hf-file Q4_K_M.gguf \
-p "selam alikum, tu çawa yî?" \
--conversation
Transformers
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
infer_prompt = """Li jêr rêwerzek heye ku peywirek rave dike, bi têketinek ku çarçoveyek din peyda dike ve tê hev kirin. Bersivek ku daxwazê bi guncan temam dike binivîsin.
### Telîmat:
{}
### Têketin:
{}
### Bersiv:
"""
model_id = "nazimali/Mistral-Nemo-Kurdish-Instruct"
tokenizer = AutoTokenizer.from_pretrained(model_id)
bnb_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_use_double_quant=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=torch.bfloat16,
)
model = AutoModelForCausalLM.from_pretrained(
model_id,
quantization_config=bnb_config,
device_map="auto",
)
model.eval()
def call_llm(user_input, instructions=None):
instructions = instructions or "tu arîkarek alîkar î"
prompt = infer_prompt.format(instructions, user_input)
input_ids = tokenizer(
prompt,
return_tensors="pt",
add_special_tokens=False,
return_token_type_ids=False,
).to("cuda")
with torch.inference_mode():
generated_ids = model.generate(
**input_ids,
max_new_tokens=120,
do_sample=True,
temperature=0.7,
top_p=0.7,
num_return_sequences=1,
pad_token_id=tokenizer.pad_token_id,
eos_token_id=tokenizer.eos_token_id,
)
decoded_output = tokenizer.batch_decode(generated_ids)[0]
return decoded_output.replace(prompt, "").replace("</s>", "")
response = call_llm("سڵاو ئەلیکوم، چۆنیت؟")
print(response)
Training
Transformers 4.44.2
1 NVIDIA A40
Duration 7h 41m 12s
{
"total_flos": 2225817933447045000,
"train/epoch": 0.9998075072184792,
"train/global_step": 2597,
"train/grad_norm": 1.172538161277771,
"train/learning_rate": 0,
"train/loss": 0.7774,
"train_loss": 0.892096030377038,
"train_runtime": 27479.3172,
"train_samples_per_second": 1.512,
"train_steps_per_second": 0.095
}
Finetuning data:
saillab/alpaca-kurdish_kurmanji-cleaned- Dataset number of rows: 52,002
- Filtered columns
instruction, output- Must have at least 1 character
- Must be less than 10,000 characters
- Number of rows used for training: 41,559
Finetuning instruction format:
finetune_prompt = """Li jêr rêwerzek heye ku peywirek rave dike, bi têketinek ku çarçoveyek din peyda dike ve tê hev kirin. Bersivek ku daxwazê bi guncan temam dike binivîsin.
### Telîmat:
{}
### Têketin:
{}
### Bersiv:
{}
"""
- Downloads last month
- 149
Model tree for nazimali/Mistral-Nemo-Kurdish-Instruct
Base model
mistralai/Mistral-Nemo-Base-2407
Install from brew
# Start a local OpenAI-compatible server with a web UI: llama-server -hf nazimali/Mistral-Nemo-Kurdish-Instruct:# Run inference directly in the terminal: llama-cli -hf nazimali/Mistral-Nemo-Kurdish-Instruct: