Instructions to use muzaffercky/Sorjin2-12B-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use muzaffercky/Sorjin2-12B-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="muzaffercky/Sorjin2-12B-Instruct") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("muzaffercky/Sorjin2-12B-Instruct") model = AutoModelForMultimodalLM.from_pretrained("muzaffercky/Sorjin2-12B-Instruct", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.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=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use muzaffercky/Sorjin2-12B-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "muzaffercky/Sorjin2-12B-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": "muzaffercky/Sorjin2-12B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/muzaffercky/Sorjin2-12B-Instruct
- SGLang
How to use muzaffercky/Sorjin2-12B-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 "muzaffercky/Sorjin2-12B-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": "muzaffercky/Sorjin2-12B-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 "muzaffercky/Sorjin2-12B-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": "muzaffercky/Sorjin2-12B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use muzaffercky/Sorjin2-12B-Instruct with Docker Model Runner:
docker model run hf.co/muzaffercky/Sorjin2-12B-Instruct
Sorjîn2-12B-Instruct
⚠️ This model answers Kurmanji questions in Turkish
Asked in Kurmanji, this model usually answers in Turkish. It is kept for reference only and is not recommended for use.
For Kurmanji chat, use Sorjîn1.1-7B-Instruct or gemma-4-12B-it until a corrected version is available.
- Known issue: In a test of 8 Kurmanji chat prompts with greedy decoding, all 8 answers were in Turkish. gemma-4-12B-it answered the same prompts in Kurmanji.
- Cause: The Sorjîn2-LoRA adapter was trained on the base model
google/gemma-4-12Band merged at full strength into the instruct model. Merged this way, it overrides the instruct model's habit of answering in the language of the question - Strength test: With the adapter added to gemma-4-12B-it at half strength or less, the same 8 prompts were answered in Kurmanji. At 0.75 strength 6 of 8 answers were in Turkish
- Planned fix: Fine-tuning on Kurmanji instruction data, so that the model learns to answer Kurmanji questions in Kurmanji. Sorjîn2-12B, the base model with the same adapter merged in, is a possible starting point for that fine-tuning
A Kurdish Kurmanji (Latin script) chat model: google/gemma-4-12B-it with the Sorjin2-LoRA adapter merged into its weights. The adapter was trained by continual pretraining on 585M tokens of mostly Kurmanji text, on the base model google/gemma-4-12B.
It is the second version of Sorjîn, after Sorjin1.1-7B-Instruct, which was built on Qwen2.5-7B.
How It Was Made
The adapter was added directly to the instruct model:
Sorjin2-12B-Instruct = gemma-4-12B-it + Sorjin2-LoRA
This keeps both parts in full: everything instruction tuning gave gemma-4-12B-it (following instructions, the chat template, answer style) and the Kurmanji knowledge in the adapter. All 328 adapted modules, the attention and MLP projections of the 48 text layers, were merged. The vision and audio parts of the model are unchanged from gemma-4-12B-it.
No Kurdish instruction data was used. The model answers in Kurmanji because the Kurmanji knowledge learned on the base model carries over to the instruct model, which is close to it.
Models
| Model | Description |
|---|---|
muzaffercky/Sorjin2-12B-Instruct |
This model |
muzaffercky/Sorjin2-12B |
google/gemma-4-12B with the adapter merged in, for text completion |
muzaffercky/Sorjin2-LoRA |
The adapter on its own |
Usage
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "muzaffercky/Sorjin2-12B-Instruct"
model = AutoModelForCausalLM.from_pretrained(model_id, dtype=torch.bfloat16, device_map="cuda")
tokenizer = AutoTokenizer.from_pretrained(model_id)
messages = [{"role": "user", "content": "Ji kerema xwe bi kurmancî behsa Amedê bike."}]
inputs = tokenizer.apply_chat_template(
messages, add_generation_prompt=True, return_tensors="pt", return_dict=True
).to(model.device)
output_ids = model.generate(**inputs, max_new_tokens=300)
print(tokenizer.decode(output_ids[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
The tokenizer and chat template are the unchanged ones of gemma-4-12B-it. In bfloat16 the model needs about 24 GB of GPU memory.
Training Data of the Adapter
One epoch over 585M tokens, counted with the Gemma 4 tokenizer:
| Dataset | Part used | Documents | Tokens | Role |
|---|---|---|---|---|
| HuggingFaceFW/fineweb-2 | kmr_Latn train |
444,677 | 454.6M | Main Kurmanji corpus |
| muzaffercky/kurdish-theses-yok | Kurmanji theses, 97% of theses | 398 | 42.7M | Academic register |
| HuggingFaceFW/fineweb-edu | sample-10BT |
84,667 | 87.8M | English replay against forgetting, 15% of the mix |
LoRA rank 64, alpha 128, learning rate 1e-4 with a cosine schedule, 17,865 steps of 16 sequences of 2,048 tokens, bfloat16, one H100 for about 66 hours. The full settings are on the Sorjin2-LoRA page.
Evaluation
Eval loss of the adapter on the base model, on held-out text:
| Eval set | gemma-4-12B |
gemma-4-12B + Sorjin2-LoRA |
|---|---|---|
fineweb-2 kmr_Latn test split |
2.274 | 1.620 |
| Kurmanji theses (8 held-out theses) | 2.347 | 1.862 |
| fineweb-edu (English) | 2.213 | 2.159 |
These losses were measured on the base model with the adapter, not on this instruct model. Benchmark results for this model (FLORES-200, Belebele) and comparisons with gemma-4-12B-it and Sorjîn1.1 have not been run yet and will be added here.
Limitations
- Not evaluated yet beyond the losses above. Check its answers before relying on them.
- No Kurdish instruction data was used, so the answers in Kurmanji depend on what carries over from the adapter. Instruction following may be slightly weaker than in
gemma-4-12B-it, and the model may sometimes answer in another language or mix in Turkish or English words. - Kurmanji in Latin script only. Sorani and other Kurdish varieties were not trained.
- Most of the Kurmanji training text is web text. The model reproduces its style, including inconsistent spelling and Turkish-influenced phrasing, and may produce wrong or biased content.
- Image and audio input are unchanged from
gemma-4-12B-itand were not tested with Kurmanji. - Use is subject to the license and terms of the base model,
google/gemma-4-12B-it.
- Downloads last month
- 8