Text Generation
Transformers
TensorBoard
Safetensors
Kyrgyz
gemma3_text
Generated from Trainer
trl
sft
conversational
text-generation-inference
Instructions to use murat/kyrgyz_umlaut_corrector with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use murat/kyrgyz_umlaut_corrector with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="murat/kyrgyz_umlaut_corrector") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("murat/kyrgyz_umlaut_corrector") model = AutoModelForCausalLM.from_pretrained("murat/kyrgyz_umlaut_corrector", 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 murat/kyrgyz_umlaut_corrector with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "murat/kyrgyz_umlaut_corrector" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "murat/kyrgyz_umlaut_corrector", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/murat/kyrgyz_umlaut_corrector
- SGLang
How to use murat/kyrgyz_umlaut_corrector 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 "murat/kyrgyz_umlaut_corrector" \ --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": "murat/kyrgyz_umlaut_corrector", "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 "murat/kyrgyz_umlaut_corrector" \ --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": "murat/kyrgyz_umlaut_corrector", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use murat/kyrgyz_umlaut_corrector with Docker Model Runner:
docker model run hf.co/murat/kyrgyz_umlaut_corrector
Quick start
import torch
from transformers import pipeline, AutoTokenizer
# 1. Моделдин ID'син көрсөтөбүз
model_id = "murat/kyrgyz_umlaut_corrector"
# 2. Токенайзерди жүктөйбүз. Бул бизге атайын токендерди алууга керек.
tokenizer = AutoTokenizer.from_pretrained(model_id)
# 3. Pipeline'ды түзөбүз
# Эгер токенайзерди өзүнчө жүктөсөк, pipeline аны туура колдонот.
generator = pipeline(
"text-generation",
model=model_id,
tokenizer=tokenizer,
device="cpu", # cuda
# torch_dtype=torch.bfloat16 # uncomment this line if you are using cuda
)
# 4. Токтотуучу токендин ID'син алабыз
# Gemma чат модели үчүн ар бир жооптун аягы ушул токен менен белгиленет.
stop_token_id = tokenizer.convert_tokens_to_ids("<end_of_turn>")
# 5. Текстти даярдайбыз
incorrect_text = "омур бою иштеген адамдар чынында бактылуу деп ойлойсунбу?"
chat_prompt = [{"role": "user", "content": incorrect_text}]
# 6. Моделди керектүү параметрлер менен чакырабыз
output = generator(
chat_prompt,
max_new_tokens=128,
return_full_text=False,
# Бул эң маанилүү параметр: ушул токенге жеткенде генерацияны токтот
eos_token_id=stop_token_id,
# Так оңдоо үчүн do_sample=False койгон жакшы.
# Бул моделди эң ыктымалдуу жоопту тандоого мажбурлайт.
do_sample=False
)
# 7. Жыйынтыкты чыгарабыз
# .strip() методу ашыкча боштуктарды же саптарды тазалайт
corrected_text = output[0]["generated_text"].strip()
print(corrected_text)
# Күтүлгөн жыйынтык:
# өмүр бою иштеген адамдар чынында бактылуу деп ойлойсуңбу?
Training procedure
This model was trained with SFT.
Framework versions
- TRL: 0.21.0
- Transformers: 4.55.0
- Pytorch: 2.6.0+cu124
- Datasets: 4.0.0
- Tokenizers: 0.21.4
Citations
Cite TRL as:
@misc{vonwerra2022trl,
title = {{TRL: Transformer Reinforcement Learning}},
author = {Leandro von Werra and Younes Belkada and Lewis Tunstall and Edward Beeching and Tristan Thrush and Nathan Lambert and Shengyi Huang and Kashif Rasul and Quentin Gallou{\'e}dec},
year = 2020,
journal = {GitHub repository},
publisher = {GitHub},
howpublished = {\url{https://github.com/huggingface/trl}}
}
- Downloads last month
- 20
Model tree for murat/kyrgyz_umlaut_corrector
Base model
google/gemma-3-270m Finetuned
google/gemma-3-270m-it