Text Generation
Transformers
Safetensors
Kurdish
Central Kurdish
t5
text2text-generation
kurdish
sorani
spellchecker
byt5
seq2seq
nlp
spell-correction
text-generation-inference
Instructions to use akam-ot/kurdish-spellchecker-sorani-byt5 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use akam-ot/kurdish-spellchecker-sorani-byt5 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="akam-ot/kurdish-spellchecker-sorani-byt5")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("akam-ot/kurdish-spellchecker-sorani-byt5") model = AutoModelForSeq2SeqLM.from_pretrained("akam-ot/kurdish-spellchecker-sorani-byt5", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use akam-ot/kurdish-spellchecker-sorani-byt5 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "akam-ot/kurdish-spellchecker-sorani-byt5" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "akam-ot/kurdish-spellchecker-sorani-byt5", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/akam-ot/kurdish-spellchecker-sorani-byt5
- SGLang
How to use akam-ot/kurdish-spellchecker-sorani-byt5 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 "akam-ot/kurdish-spellchecker-sorani-byt5" \ --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": "akam-ot/kurdish-spellchecker-sorani-byt5", "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 "akam-ot/kurdish-spellchecker-sorani-byt5" \ --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": "akam-ot/kurdish-spellchecker-sorani-byt5", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use akam-ot/kurdish-spellchecker-sorani-byt5 with Docker Model Runner:
docker model run hf.co/akam-ot/kurdish-spellchecker-sorani-byt5
Kurdish Sorani Spellchecker (ByT5-base)
A ByT5-base sequence-to-sequence model fine-tuned for automatic Kurdish Sorani spellchecking.
Model Description
This model takes a potentially misspelled Kurdish Sorani sentence as input and outputs the corrected version. It operates at the byte level using Google's ByT5 architecture, making it robust to the character-level variations common in Kurdish text.
Usage
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
import torch
model_id = "akam-ot/kurdish-spellchecker-sorani-byt5"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForSeq2SeqLM.from_pretrained(model_id)
def spellcheck(text):
inputs = tokenizer(text, return_tensors="pt")
input_len = inputs["input_ids"].shape[1]
with torch.no_grad():
outputs = model.generate(
**inputs,
max_length=input_len + 20,
num_beams=4,
early_stopping=True,
)
return tokenizer.decode(outputs[0], skip_special_tokens=True)
print(spellcheck("كوردستان ولاتێكە"))
# → کوردستان وڵاتێکە
Limitations
- Optimized for Sorani Kurdish — not tested on Kurmanji or other dialects
- Best on sentences up to ~128 tokens; longer texts should be split into sentences
- May occasionally hallucinate on very short or ambiguous inputs
Author
Akam GitHub · HuggingFace
- Downloads last month
- 37
Model tree for akam-ot/kurdish-spellchecker-sorani-byt5
Base model
google/byt5-base