Instructions to use muzaffercky/Sorjin2.1-12B-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use muzaffercky/Sorjin2.1-12B-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="muzaffercky/Sorjin2.1-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.1-12B-Instruct") model = AutoModelForMultimodalLM.from_pretrained("muzaffercky/Sorjin2.1-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.1-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.1-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.1-12B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/muzaffercky/Sorjin2.1-12B-Instruct
- SGLang
How to use muzaffercky/Sorjin2.1-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.1-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.1-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.1-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.1-12B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use muzaffercky/Sorjin2.1-12B-Instruct with Docker Model Runner:
docker model run hf.co/muzaffercky/Sorjin2.1-12B-Instruct
Sorjîn2.1-12B-Instruct
A Kurdish Kurmanji (Latin script) chat model, built on google/gemma-4-12B-it in two steps:
Sorjin2-12B-Instruct = gemma-4-12B-it + Sorjin2-LoRA
Sorjin2.1-12B-Instruct = Sorjin2-12B-Instruct + Sorjin2-12B-Instruct-LoRA
- Continual pretraining. The Sorjin2-LoRA adapter was trained on 585M tokens of mostly Kurmanji text, on the base model
google/gemma-4-12B, and merged intogemma-4-12B-it. The result, Sorjin2-12B-Instruct, knows more Kurmanji but answers Kurmanji chat questions in Turkish. - Instruction tuning. The Sorjin2-12B-Instruct-LoRA adapter was trained on top of
Sorjin2-12B-Instructon 30k Kurmanji question and answer pairs, and merged into it. This model answers in Kurmanji.
All 328 adapted modules of each adapter, 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.
It is the second version of Sorjîn, after Sorjin1.1-7B-Instruct, which was built on Qwen2.5-7B. The .1 marks a rebuild on the same continual pretraining as Sorjin2-12B-Instruct, not a new one.
Models
| Model | Description |
|---|---|
muzaffercky/Sorjin2.1-12B-Instruct |
This model |
muzaffercky/Sorjin2-12B-Instruct |
google/gemma-4-12B-it with Sorjin2-LoRA merged in. Answers in Turkish; the base of this model |
muzaffercky/Sorjin2-12B-Instruct-LoRA |
The instruction tuning adapter on its own |
muzaffercky/Sorjin2-12B |
google/gemma-4-12B with Sorjin2-LoRA merged in, for text completion |
muzaffercky/Sorjin2-LoRA |
The continual pretraining adapter on its own |
Usage
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "muzaffercky/Sorjin2.1-12B-Instruct"
model = AutoModelForCausalLM.from_pretrained(model_id, dtype=torch.bfloat16, device_map="cuda")
tokenizer = AutoTokenizer.from_pretrained(model_id)
messages = [{"role": "user", "content": "LoRA çawa dixebite?"}]
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, do_sample=True, temperature=1.0, top_p=0.95, top_k=64)
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. The model was instruction-tuned without thinking: every training prompt ends with the template's empty thinking block. In bfloat16 the model needs about 24 GB of GPU memory.
Training Data
Continual pretraining (Sorjin2-LoRA)
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 |
Instruction tuning (Sorjin2-12B-Instruct-LoRA)
A cleaned copy of muzaffercky/kurdish-ins: Kurmanji questions written by Gemini, with answers copied verbatim from fineweb-2 kmr_Latn and Kurmanji theses. The answers are human-written Kurmanji; their style is that of web text and academic writing, not of an assistant.
The cleaning script repairs garbled letters (þ for ş, for example) whose correct form is certain and drops the pairs whose garbling has no single correct form, keeping 30,927 of 32,991 pairs. After dropping duplicates and conversations longer than 2,048 tokens, 29,985 conversations (17.5M tokens) were used for training and 537 were held out for evaluation. A quarter of the conversations start with a Kurmanji system prompt. Only the answers were trained on.
Training
| Setting | Continual pretraining | Instruction tuning |
|---|---|---|
| Trained on | google/gemma-4-12B |
Sorjin2-12B-Instruct |
| LoRA rank / alpha / dropout | 64 / 128 / 0.05 | 32 / 64 / 0.05 |
| Target modules | Attention and MLP projections, 328 modules | Same |
| Batch size | 16 sequences of 2,048 tokens | 16 conversations |
| Steps | 17,865 (one epoch) | 3,750 (two epochs) |
| Learning rate | 1e-4, cosine, 2% warmup | 1e-4, cosine, 3% warmup |
| Precision | bfloat16, no quantization | Same |
| Hardware | One H100 80GB, about 66 hours | One H100 80GB, about 4.5 hours |
Each adapter is the checkpoint with the lowest Kurmanji eval loss. The full settings are on the adapter pages.
Evaluation
| Measure | Before | After |
|---|---|---|
Continual pretraining: eval loss on fineweb-2 kmr_Latn test split, gemma-4-12B → + Sorjin2-LoRA |
2.274 | 1.620 |
Instruction tuning: eval loss on 537 held-out kurdish-ins answers, Sorjin2-12B-Instruct → + Sorjin2-12B-Instruct-LoRA |
3.235 | 1.932 |
An eval loss is computed on a given answer, so it cannot show which language the model chooses when it writes its own answer. That was checked separately: Kurmanji questions (eight for the first two rows, seven during instruction tuning) were answered with greedy decoding, and each answer was scored by its share of letters that only Turkish has (ı, ğ, ö, ü) and letters that only Kurmanji has (ê, î, û).
| Model | Turkish-only letters | Kurmanji-only letters |
|---|---|---|
gemma-4-12B-it |
0.1% | 12.0% |
Sorjin2-12B-Instruct |
8.1% | 0.1% |
| During instruction tuning | 0% | 10–12% |
Benchmark results (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 measures above. Check its answers before relying on them.
- With greedy decoding, some answers fall into a loop and repeat one phrase until the token limit. Use sampling, and a mild repetition penalty if needed.
- The instruction tuning answers are web and thesis passages, not assistant answers. The model tends to answer in that register: long, run-on paragraphs rather than short, structured replies.
- The instruction tuning questions were written by a model and the answers were not written for them, so some answers only partly answer their question. The model may do the same.
- The instruction tuning data is Kurmanji only. English and other abilities of
gemma-4-12B-itwere not measured after it. - 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
google/gemma-4-12B-it.
- Downloads last month
- -
Model tree for muzaffercky/Sorjin2.1-12B-Instruct
Base model
google/gemma-4-12B