Instructions to use TilQazyna/Til-2B-GEC with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use TilQazyna/Til-2B-GEC with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="TilQazyna/Til-2B-GEC") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("TilQazyna/Til-2B-GEC") model = AutoModelForCausalLM.from_pretrained("TilQazyna/Til-2B-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-2B-GEC with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "TilQazyna/Til-2B-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-2B-GEC", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/TilQazyna/Til-2B-GEC
- SGLang
How to use TilQazyna/Til-2B-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-2B-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-2B-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-2B-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-2B-GEC", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use TilQazyna/Til-2B-GEC with Docker Model Runner:
docker model run hf.co/TilQazyna/Til-2B-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-2B-GEC
Қазақ мәтініндегі қатені түзету · Исправление ошибок в казахском тексте · Kazakh grammatical error correction
Қазақша
Til-2B-GEC — қазақ мәтініндегі грамматикалық, орфографиялық және пунктуациялық қателерді түзететін 1977M параметрлі модель. Репозиторий көлемі — 3.97 ГБ. Ол Til-2B негізінде Til-GEC деректерімен fine-tune жасалған.
Құрылымы мен міндеті
| Сипаттама | Мәні |
|---|---|
| Архитектура | DeepseekV3ForCausalLM, MLA |
| Қабат саны | 30 |
| Контекст | 4096 токен |
| Формат | ChatML |
| Оқыту деректері | шамамен 316K қазақша GEC жұбы |
Модель септік, жіктік, тәуелдік, көптік, шақ, болымсыздық, сөз тәртібі және емле қателері бар қысқа мәтіндерге арналған. Кейде сөйлемді аздап қайта құруы мүмкін.
Іске қосу
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "TilQazyna/Til-2B-GEC"
tokenizer = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo)
message = "Мәтіндегі қателерді түзет. Тек түзетілген мәтінді қайтар.\n\nМәтін: кеше жанбыр жауды"
prompt = tokenizer.apply_chat_template([{"role": "user", "content": message}], tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt")
output = model.generate(**inputs, max_new_tokens=128, do_sample=False)
print(tokenizer.decode(output[0][inputs.input_ids.shape[1]:], skip_special_tokens=True))
Қолжетімділік
Карточка мен файлдар тізімі ашық. Жүктеу үшін «Request access» өтінімін TilQazyna командасы қарайды.
Байланысты репозиторийлер
Base-модель — Til-2B, оқыту деректері — Til-GEC.
Русский
Til-2B-GEC — модель на 1977M параметров для исправления грамматических, орфографических и пунктуационных ошибок в казахском тексте. Объём репозитория — 3.97 ГБ. Это fine-tune Til-2B на Til-GEC.
Устройство и задача
| Характеристика | Значение |
|---|---|
| Архитектура | DeepseekV3ForCausalLM, MLA |
| Слоёв | 30 |
| Контекст | 4096 токенов |
| Формат | ChatML |
| Данные обучения | около 316K казахских GEC-пар |
Модель работает с падежами, личными и притяжательными окончаниями, числом, временем, отрицанием, порядком слов и орфографией в коротких текстах. Иногда она слегка перефразирует исходную фразу.
Как запустить
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "TilQazyna/Til-2B-GEC"
tokenizer = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo)
message = "Мәтіндегі қателерді түзет. Тек түзетілген мәтінді қайтар.\n\nМәтін: кеше жанбыр жауды"
prompt = tokenizer.apply_chat_template([{"role": "user", "content": message}], tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt")
output = model.generate(**inputs, max_new_tokens=128, do_sample=False)
print(tokenizer.decode(output[0][inputs.input_ids.shape[1]:], skip_special_tokens=True))
Доступ
Карточка и файлы перечислены публично. Скачивание открывается после рассмотрения командой TilQazyna заявки через «Request access».
Связанные репозитории
Базовая модель — Til-2B, данные обучения — Til-GEC.
English
Til-2B-GEC is a 1977M-parameter model for correcting grammatical, spelling, and punctuation errors in Kazakh text. The repository occupies 3.97 GB. It fine-tunes Til-2B on Til-GEC.
Architecture and task
| Characteristic | Value |
|---|---|
| Architecture | DeepseekV3ForCausalLM, MLA |
| Layers | 30 |
| Context | 4096 tokens |
| Format | ChatML |
| Training data | about 316K Kazakh GEC pairs |
The model covers case, personal and possessive endings, number, tense, negation, word order, and spelling in short texts. It may occasionally rephrase the input instead of making a minimal edit.
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "TilQazyna/Til-2B-GEC"
tokenizer = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo)
message = "Мәтіндегі қателерді түзет. Тек түзетілген мәтінді қайтар.\n\nМәтін: кеше жанбыр жауды"
prompt = tokenizer.apply_chat_template([{"role": "user", "content": message}], tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt")
output = model.generate(**inputs, max_new_tokens=128, do_sample=False)
print(tokenizer.decode(output[0][inputs.input_ids.shape[1]:], skip_special_tokens=True))
Access
The card and file list are public. Downloads require approval of a request submitted through “Request access” and reviewed by the TilQazyna team.
Related repositories
The base checkpoint is Til-2B, and the training dataset is Til-GEC.
Лицензия · License: apache-2.0 · TilQazyna
- Downloads last month
- 20
Model tree for TilQazyna/Til-2B-GEC
Base model
TilQazyna/Til-2B