Instructions to use TilQazyna/Til-Core-1B-GEC with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use TilQazyna/Til-Core-1B-GEC with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="TilQazyna/Til-Core-1B-GEC") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("TilQazyna/Til-Core-1B-GEC") model = AutoModelForCausalLM.from_pretrained("TilQazyna/Til-Core-1B-GEC", device_map="auto") 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use TilQazyna/Til-Core-1B-GEC with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "TilQazyna/Til-Core-1B-GEC" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TilQazyna/Til-Core-1B-GEC", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/TilQazyna/Til-Core-1B-GEC
- SGLang
How to use TilQazyna/Til-Core-1B-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-Core-1B-GEC" \ --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": "TilQazyna/Til-Core-1B-GEC", "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 "TilQazyna/Til-Core-1B-GEC" \ --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": "TilQazyna/Til-Core-1B-GEC", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use TilQazyna/Til-Core-1B-GEC with Docker Model Runner:
docker model run hf.co/TilQazyna/Til-Core-1B-GEC
You need to agree to share your contact information to access this model
This repository is publicly accessible, but you have to accept the conditions to access its files and content.
Бұл репозиторийге қолжетімділік өтінім бойынша беріледі. Өзіңіз туралы және деректерді қалай қолданатыңыз туралы жазыңыз — өтінімді TilQazyna командасы қарайды. · Доступ к репозиторию выдаётся по заявке. Расскажите о себе и о том, как собираетесь использовать данные — заявку рассматривает команда TilQazyna. · Access to this repository is granted on request. Tell us who you are and how you plan to use the material; the TilQazyna team reviews each application.
Log in or Sign Up to review the conditions and access this model content.
Til-Core-1B-GEC
Қазақ мәтініндегі қателерді түзету моделі · Модель исправления ошибок в казахском тексте · Kazakh grammatical error correction model
Қазақша
Til-Core-1B-GEC — қазақ мәтініндегі грамматикалық, орфографиялық және пунктуациялық қателерді аз өзгеріспен түзететін 1.25B параметрлі GEC моделі. Репозиторий көлемі — 5.01 ГБ; модель Til-Core-1B негізінде fine-tune жасалған.
Модель арнайы tag пішімін қолданады және дұрыс мәтінді көшіріп қайтару мысалдарымен үйретілген. Ол жалпы chat орнына қазақша GEC міндетіне арналған.
Құрылымы мен үйрету
| Сипаттама | Мәні |
|---|---|
| Архитектура | LlamaForCausalLM |
| Параметр саны | 1.25B |
| Жасырын қабат өлшемі | 2048 |
| Қабат саны | 16 |
| Attention басы | 32 |
| Сөздік | 256003 токен |
| Контекст ұзындығы | 2048 токен |
| Үйрету жұбы | 22 021 |
| Identity мысалдарының үлесі | 20% |
| Epoch | 3 |
Кіріс <TASK_FIX><SRC>{text}<SEP> түрінде беріледі. Үйрету кезінде <SEP> таңбасына дейінгі бөлік loss есебінен шығарылған.
Бағалау
| Бөлік немесе көрсеткіш | Нәтиже |
|---|---|
| test chrF | 89.6 |
| Exact match | 27.5 |
| Keep-correct | 80.8 |
| organic chrF | 85.7 |
| synthetic chrF | 80.5 |
Нәтижелер sozkz GEC benchmark арқылы өлшенген. Модель сирек және күрделі қате түрлерін өткізіп алуы мүмкін. Шығысты бастапқы жолмен салыстырып тексеруге болады.
Іске қосу
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "TilQazyna/Til-Core-1B-GEC"
tokenizer = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(
repo, dtype=torch.bfloat16, device_map="auto"
).eval()
text = "Әйелдердың туу көрсеткіші жылдан-жылға өсуде."
prompt = f"<TASK_FIX><SRC>{text}<SEP>"
inputs = tokenizer(prompt, return_tensors="pt", add_special_tokens=False).to(model.device)
output = model.generate(**inputs, max_new_tokens=80, do_sample=False)
answer = output[0][inputs["input_ids"].shape[1]:]
print(tokenizer.decode(answer, skip_special_tokens=True).split("\n")[0])
Қолжетімділік
Карточка мен файлдар тізімі жалпыға көрінеді. Файлдарды жүктеу үшін «Request access» арқылы өтінім қалдырылады; TilQazyna командасы оны мақұлдаған соң қолжетімділік беріледі.
Байланысты репозиторийлер
Базалық checkpoint — Til-Core-1B. GEC деректерінің TilQazyna репозиторийі — Til-GEC.
Русский
Til-Core-1B-GEC — GEC-модель на 1.25B параметров для исправления грамматических, орфографических и пунктуационных ошибок в казахском тексте с минимальными правками. Репозиторий занимает 5.01 ГБ; модель получила fine-tune на основе Til-Core-1B.
Модель принимает специальный формат с тегами и обучена на примерах, где правильный текст нужно вернуть без изменений. Она предназначена для казахского GEC, а не для общего chat.
Устройство и обучение
| Характеристика | Значение |
|---|---|
| Архитектура | LlamaForCausalLM |
| Параметров | 1.25B |
| Размер скрытого слоя | 2048 |
| Слоёв | 16 |
| Голов attention | 32 |
| Словарь | 256003 токена |
| Длина контекста | 2048 токенов |
| Обучающих пар | 22 021 |
| Доля identity-примеров | 20% |
| Epoch | 3 |
Вход оформляется как <TASK_FIX><SRC>{text}<SEP>. При обучении часть до маркера <SEP> исключалась из расчёта loss.
Оценка
| Часть или показатель | Результат |
|---|---|
| test chrF | 89.6 |
| Exact match | 27.5 |
| Keep-correct | 80.8 |
| organic chrF | 85.7 |
| synthetic chrF | 80.5 |
Метрики получены на sozkz GEC benchmark. Модель может пропускать редкие и сложные типы ошибок.
Как запустить
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "TilQazyna/Til-Core-1B-GEC"
tokenizer = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(
repo, dtype=torch.bfloat16, device_map="auto"
).eval()
text = "Әйелдердың туу көрсеткіші жылдан-жылға өсуде."
prompt = f"<TASK_FIX><SRC>{text}<SEP>"
inputs = tokenizer(prompt, return_tensors="pt", add_special_tokens=False).to(model.device)
output = model.generate(**inputs, max_new_tokens=80, do_sample=False)
answer = output[0][inputs["input_ids"].shape[1]:]
print(tokenizer.decode(answer, skip_special_tokens=True).split("\n")[0])
Доступ
Карточка и список файлов открыты для просмотра. Скачивание разрешается после одобрения заявки, отправленной через «Request access»; её рассматривает команда TilQazyna.
Связанные репозитории
Базовый checkpoint — Til-Core-1B. Репозиторий TilQazyna с данными GEC — Til-GEC.
English
Til-Core-1B-GEC is a 1.25B-parameter GEC model for minimal-edit correction of grammatical, spelling, and punctuation errors in Kazakh. The repository is 5.01 GB; the checkpoint was fine-tuned from Til-Core-1B.
The model accepts a dedicated tagged format and was trained with identity examples that require correct inputs to be copied unchanged. Its scope is Kazakh GEC rather than general chat.
Architecture and training
| Property | Value |
|---|---|
| Architecture | LlamaForCausalLM |
| Parameters | 1.25B |
| Hidden size | 2048 |
| Layers | 16 |
| Attention heads | 32 |
| Vocabulary | 256003 tokens |
| Context length | 2048 tokens |
| Training pairs | 22 021 |
| Identity-example share | 20% |
| Epochs | 3 |
Inputs use the form <TASK_FIX><SRC>{text}<SEP>. During training, tokens before <SEP> were masked out of the loss calculation.
Evaluation
| Split or metric | Result |
|---|---|
| test chrF | 89.6 |
| Exact match | 27.5 |
| Keep-correct | 80.8 |
| organic chrF | 85.7 |
| synthetic chrF | 80.5 |
The reported metrics come from the sozkz GEC benchmark. Rare and structurally complex error types may remain uncorrected.
Usage
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "TilQazyna/Til-Core-1B-GEC"
tokenizer = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(
repo, dtype=torch.bfloat16, device_map="auto"
).eval()
text = "Әйелдердың туу көрсеткіші жылдан-жылға өсуде."
prompt = f"<TASK_FIX><SRC>{text}<SEP>"
inputs = tokenizer(prompt, return_tensors="pt", add_special_tokens=False).to(model.device)
output = model.generate(**inputs, max_new_tokens=80, do_sample=False)
answer = output[0][inputs["input_ids"].shape[1]:]
print(tokenizer.decode(answer, skip_special_tokens=True).split("\n")[0])
Access
The model card and file list can be viewed publicly. Downloading requires approval of a submission made through “Request access”; the TilQazyna team reviews the request.
Related repositories
The base checkpoint is Til-Core-1B. TilQazyna's GEC data repository is Til-GEC.
Лицензия · License: apache-2.0 · TilQazyna
- Downloads last month
- 9
Model tree for TilQazyna/Til-Core-1B-GEC
Base model
TilQazyna/Til-Core-1B