Text Generation
Transformers
Safetensors
Kazakh
llama
grammar-error-correction
kazakh
gec
sozkz
text-generation-inference
Instructions to use stukenov/sozkz-core-llama-600m-kk-gec-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use stukenov/sozkz-core-llama-600m-kk-gec-v1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="stukenov/sozkz-core-llama-600m-kk-gec-v1")# Load model directly from transformers import AutoTokenizer, AutoModelForMultimodalLM tokenizer = AutoTokenizer.from_pretrained("stukenov/sozkz-core-llama-600m-kk-gec-v1") model = AutoModelForMultimodalLM.from_pretrained("stukenov/sozkz-core-llama-600m-kk-gec-v1") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use stukenov/sozkz-core-llama-600m-kk-gec-v1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "stukenov/sozkz-core-llama-600m-kk-gec-v1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "stukenov/sozkz-core-llama-600m-kk-gec-v1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/stukenov/sozkz-core-llama-600m-kk-gec-v1
- SGLang
How to use stukenov/sozkz-core-llama-600m-kk-gec-v1 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 "stukenov/sozkz-core-llama-600m-kk-gec-v1" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "stukenov/sozkz-core-llama-600m-kk-gec-v1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "stukenov/sozkz-core-llama-600m-kk-gec-v1" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "stukenov/sozkz-core-llama-600m-kk-gec-v1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use stukenov/sozkz-core-llama-600m-kk-gec-v1 with Docker Model Runner:
docker model run hf.co/stukenov/sozkz-core-llama-600m-kk-gec-v1
How to use from
Docker Model Runnerdocker model run hf.co/stukenov/sozkz-core-llama-600m-kk-gec-v1Quick Links
SozKZ Core Llama 600M — Kazakh GEC v1
Казақ тіліне арналған грамматикалық қателерді түзету моделі (Grammar Error Correction). 600M параметр.
Model Details
| Parameter | Value |
|---|---|
| Architecture | LlamaForCausalLM (decoder-only) |
| Parameters | 587M |
| Base model | stukenov/sozkz-core-llama-600m-kk-base-v1 |
| Training data | sozkz-corpus-synthetic-kk-gec-v1 |
| Training | 3 epochs, LR=1.5e-5, BS=128, cosine schedule |
| Clean ratio | 80% |
| Data filter | word edit distance ≤ 2 |
| Tag | Single <грамматика> (unified) |
| Format | Thinking (💭 diff → corrected) |
| Hardware | 2× RTX 4090 (vast.ai), ~1.7h |
| License | MIT (gated access) |
Format
<грамматика> ошибочный текст
💭 слово1→слово2 (описание)
→ исправленный текст
Usage
from transformers import AutoModelForCausalLM, GPT2TokenizerFast
from huggingface_hub import hf_hub_download
import torch
model_id = "stukenov/sozkz-core-llama-600m-kk-gec-v1"
tok_file = hf_hub_download(repo_id=model_id, filename="tokenizer.json")
tokenizer = GPT2TokenizerFast(tokenizer_file=tok_file)
tokenizer.pad_token = tokenizer.eos_token
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.bfloat16)
model.eval()
def correct(text):
prompt = f"<грамматика> {text}\n"
inputs = tokenizer(prompt, return_tensors="pt", truncation=True, max_length=480)
with torch.no_grad():
out = model.generate(**inputs, max_new_tokens=len(inputs["input_ids"][0])+60,
temperature=0.3, top_p=0.9, do_sample=True, repetition_penalty=1.1,
pad_token_id=tokenizer.eos_token_id)
result = tokenizer.decode(out[0], skip_special_tokens=True)
if "→ " in result: result = result.split("→ ", 1)[1]
for stop in ["\n<", "\n\n"]:
if stop in result: result = result[:result.index(stop)]
return result.strip() or text
print(correct("Студенттар университетте оқиды."))
Part of SozKZ Project
This model is part of the SozKZ project for Kazakh language AI.
Benchmark Results
Evaluated on 100-example custom GEC test (pure model inference, no pre/post pipeline).
🏆 Лучшая модель в SozKZ GEC benchmark (100-example custom test)
| Category | Score |
|---|---|
| Орфография (емле) | 15/30 (50%) |
| Грамматика | 12/20 (60%) |
| Пунктуация | 3/15 (20%) |
| Смешанный | 2/20 (10%) |
| Identity preservation | 15/15 (100%) |
| Total | 47/100 (47%) |
Leaderboard (100-example custom benchmark)
| Модель | Total | Емле/30 | Грамм/20 | Пункт/15 | Смеш/20 | Ident/15 |
|---|---|---|---|---|---|---|
| sozkz-core-llama-600m-kk-gec-v1 | 47% | 15 | 12 | 3 | 2 | 15/15 |
| sozkz-fix-qwen-500m-kk-gec-v3 | 38% | 0 | 16 | 9 | 0 | 13/15 |
| sozkz-core-llama-300m-kk-gec-v4 | 37% | 9 | 6 | 4 | 3 | 15/15 |
| sozkz-fix-qwen-500m-kk-gec-v1 | 35% | 0 | 12 | 8 | 0 | 15/15 |
| sozkz-fix-qwen-500m-kk-gec-v2 | 30% | 0 | 11 | 7 | 0 | 12/15 |
| sozkz-core-llama-1b-kk-gec-v1 | 16% | 2 | 6 | 1 | 0 | 7/15 |
| sozkz-fix-qwen-500m-kk-gec-v4 | 5% | 0 | 1 | 4 | 0 | 0/15 |
| sozkz-fix-mt5b-kk-gec-run13-v1 | 5% | 0 | 2 | 0 | 0 | 3/15 |
| sozkz-nllb-1b-kk-gec-v1 | 1% | 0 | 1 | 0 | 0 | 0/15 |
| sozkz-nllb-1b-kk-pretrain-v1 | 1% | 0 | 1 | 0 | 0 | 0/15 |
| sozkz-core-llama-300m-kk-gec-v3 | 1% | 0 | 1 | 0 | 0 | 0/15 |
| sozkz-core-llama-300m-kk-gec-v1/v2a/v2b | 0–1% | 0 | 0 | 0 | 0 | 0–1 |
| sozkz-fix-mt5-50m-kk-gec-v1 | 0% | 0 | 0 | 0 | 0 | 0/15 |
- Downloads last month
- -
Collection including stukenov/sozkz-core-llama-600m-kk-gec-v1
Collection
Grammar error correction models and datasets for Kazakh — Llama GEC (300M, 600M), mT5 GEC, morphology models • 10 items • Updated
# Gated model: Login with a HF token with gated access permission hf auth login