Instructions to use TilQazyna/Til-2B-instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use TilQazyna/Til-2B-instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="TilQazyna/Til-2B-instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("TilQazyna/Til-2B-instruct") model = AutoModelForCausalLM.from_pretrained("TilQazyna/Til-2B-instruct", 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use TilQazyna/Til-2B-instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "TilQazyna/Til-2B-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": "TilQazyna/Til-2B-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/TilQazyna/Til-2B-instruct
- SGLang
How to use TilQazyna/Til-2B-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 "TilQazyna/Til-2B-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": "TilQazyna/Til-2B-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 "TilQazyna/Til-2B-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": "TilQazyna/Til-2B-instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use TilQazyna/Til-2B-instruct with Docker Model Runner:
docker model run hf.co/TilQazyna/Til-2B-instruct
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-instruct
Нұсқаулық орындайтын тілдік модель · Модель для выполнения инструкций · Instruction-tuned language model
Қазақша
Til-2B-instruct — қазақша сұрақ-жауап, мәтін жазу, қорытындылау және қайта жазуға бейімделген 1977M параметрлі модель. Репозиторий көлемі — 3.97 ГБ. Ол Til-2B негізінде Til-Instruct деректерімен fine-tune жасалған.
Құрылымы мен қолданылуы
| Сипаттама | Мәні |
|---|---|
| Архитектура | DeepseekV3ForCausalLM, MLA |
| Қабат саны | 30 |
| Контекст | 4096 токен |
| Формат | ChatML |
| Оқыту деректері | шамамен 345K instruction–response жұбы |
Деректердің шамамен 70% қазақ тілінде; орыс, ағылшын, код және математика тапсырмалары да бар. Модельде safety alignment және RLHF қолданылмаған, сондықтан фактілер мен сандық жауаптар тексеріледі.
Іске қосу
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "TilQazyna/Til-2B-instruct"
tokenizer = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo, dtype=torch.bfloat16, device_map="auto")
messages = [{"role": "user", "content": "Денсаулықты сақтау үшін 3 кеңес бер."}]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
output = model.generate(**inputs, max_new_tokens=300)
print(tokenizer.decode(output[0][inputs.input_ids.shape[1]:], skip_special_tokens=True))
Қолжетімділік
Карточка мен файлдар тізімі ашық. «Request access» өтінімін TilQazyna командасы мақұлдаған соң файлдар жүктеледі.
Байланысты репозиторийлер
Base-модель — Til-2B, оқыту деректері — Til-Instruct.
Русский
Til-2B-instruct — модель на 1977M параметров для вопросов и ответов, написания, суммаризации и перефразирования с приоритетом казахского языка. Объём репозитория — 3.97 ГБ. Это fine-tune Til-2B на Til-Instruct.
Устройство и применение
| Характеристика | Значение |
|---|---|
| Архитектура | DeepseekV3ForCausalLM, MLA |
| Слоёв | 30 |
| Контекст | 4096 токенов |
| Формат | ChatML |
| Данные обучения | около 345K пар instruction–response |
Около 70% данных — на казахском; также есть задания на русском, английском, коде и математике. Safety alignment и RLHF не применялись, поэтому факты и числовые ответы нужно проверять.
Как запустить
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "TilQazyna/Til-2B-instruct"
tokenizer = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo, dtype=torch.bfloat16, device_map="auto")
messages = [{"role": "user", "content": "Денсаулықты сақтау үшін 3 кеңес бер."}]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
output = model.generate(**inputs, max_new_tokens=300)
print(tokenizer.decode(output[0][inputs.input_ids.shape[1]:], skip_special_tokens=True))
Доступ
Карточка и файлы перечислены публично. Скачивание разрешается после рассмотрения командой TilQazyna заявки через «Request access».
Связанные репозитории
Базовая модель — Til-2B, данные обучения — Til-Instruct.
English
Til-2B-instruct is a 1977M-parameter model for Kazakh-first question answering, writing, summarization, and rewriting. The repository occupies 3.97 GB. It fine-tunes Til-2B on Til-Instruct.
Architecture and use
| Characteristic | Value |
|---|---|
| Architecture | DeepseekV3ForCausalLM, MLA |
| Layers | 30 |
| Context | 4096 tokens |
| Format | ChatML |
| Training data | about 345K instruction–response pairs |
About 70% of the data is Kazakh, alongside Russian, English, code, and mathematics tasks. The checkpoint has no safety alignment or RLHF, so factual and numerical outputs should be verified.
Usage
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "TilQazyna/Til-2B-instruct"
tokenizer = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo, dtype=torch.bfloat16, device_map="auto")
messages = [{"role": "user", "content": "Денсаулықты сақтау үшін 3 кеңес бер."}]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
output = model.generate(**inputs, max_new_tokens=300)
print(tokenizer.decode(output[0][inputs.input_ids.shape[1]:], skip_special_tokens=True))
Access
The card and file list are public. Downloads require a request through “Request access,” reviewed by the TilQazyna team.
Related repositories
The base checkpoint is Til-2B, and the training dataset is Til-Instruct.
Лицензия · License: apache-2.0 · TilQazyna
- Downloads last month
- -
Model tree for TilQazyna/Til-2B-instruct
Base model
TilQazyna/Til-2B