Instructions to use TilQazyna/Til-1B-multilingual-base-GEC with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use TilQazyna/Til-1B-multilingual-base-GEC with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="TilQazyna/Til-1B-multilingual-base-GEC")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("TilQazyna/Til-1B-multilingual-base-GEC") model = AutoModelForCausalLM.from_pretrained("TilQazyna/Til-1B-multilingual-base-GEC") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use TilQazyna/Til-1B-multilingual-base-GEC with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "TilQazyna/Til-1B-multilingual-base-GEC" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TilQazyna/Til-1B-multilingual-base-GEC", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/TilQazyna/Til-1B-multilingual-base-GEC
- SGLang
How to use TilQazyna/Til-1B-multilingual-base-GEC 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 "TilQazyna/Til-1B-multilingual-base-GEC" \ --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": "TilQazyna/Til-1B-multilingual-base-GEC", "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 "TilQazyna/Til-1B-multilingual-base-GEC" \ --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": "TilQazyna/Til-1B-multilingual-base-GEC", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use TilQazyna/Til-1B-multilingual-base-GEC with Docker Model Runner:
docker model run hf.co/TilQazyna/Til-1B-multilingual-base-GEC
Til-1B-multilingual-base-GEC
Kazakh grammatical error correction (GEC) model, fine-tuned from Til-1B-multilingual-base — the token-balanced 941M multilingual base.
Given a Kazakh sentence that may contain spelling/grammar errors, the model returns the corrected sentence.
Task format
Plain seq2seq-as-causal-LM with a => separator (greedy decoding):
<input sentence with errors> => <corrected sentence>
Results — exact-match on the held-out novel test sets (100 items each)
| Test | exact_match | chrF | keep_correct |
|---|---|---|---|
| test100 | 78.0 | 93.9 | 100.0 |
| test100_v2 | 70.0 | 90.7 | 91.7 |
| test100_v3 | 71.0 | 94.4 | 83.3 |
| average | 73.0 |
Context (Til GEC ladder, same recipe & test sets): this multilingual-base GEC (avg 73.0) beats the 0.5B multilingual-base GEC (avg 68.7) and closes ~40% of the gap to the best Kazakh-monolingual GEC (Til-kk-0.5B-256k-gec-exp085, avg 79.3); on the newest set (test100_v3) it matches the monolingual model (71 = 71). keep_correct ≈ 100 % on clean input means it does not over-correct already-correct text.
Training
- Base: Til-1B-multilingual-base (DeepseekV3 MLA, 941M, 131 072 vocab / Til-Tokenizer-128k).
- Recipe: supervised fine-tuning on
"<input> => <target>"pairs, data = rule-based synthetic + 78k human-annotated + identity (keep-correct) + hard mined cases. - Hyperparameters: 3 epochs, lr 2e-5, per-device batch 16, 8 × H200,
NCCL_IB_DISABLE=1. - Precision: bfloat16.
How to use
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "TilQazyna/Til-1B-multilingual-base-GEC"
tok = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.bfloat16).eval()
def correct(sentence):
ids = tok(sentence + " => ", return_tensors="pt").input_ids
out = model.generate(ids, max_new_tokens=96, do_sample=False,
eos_token_id=tok.eos_token_id, pad_token_id=1)
text = tok.decode(out[0], skip_special_tokens=True)
return text.split(" => ", 1)[-1].strip()
print(correct("мен кітап оқыдым керек"))
Limitations
Trained for sentence-level Kazakh GEC only; not a chat model. Hard/rare error types remain the weakest (~11–15/24 on the hard bucket). 4096-token context.
Model family
Part of the Til family by TilQazyna. Base: Til-1B-multilingual-base; monolingual GEC sibling: Til-kk-0.5B-256k-gec-exp085.
- Downloads last month
- -