Instructions to use svogunas/g2p-lt-byt5-small with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use svogunas/g2p-lt-byt5-small with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="svogunas/g2p-lt-byt5-small")# Load model directly from transformers import AutoTokenizer, AutoModelForSeq2SeqLM tokenizer = AutoTokenizer.from_pretrained("svogunas/g2p-lt-byt5-small") model = AutoModelForSeq2SeqLM.from_pretrained("svogunas/g2p-lt-byt5-small") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use svogunas/g2p-lt-byt5-small with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "svogunas/g2p-lt-byt5-small" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "svogunas/g2p-lt-byt5-small", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/svogunas/g2p-lt-byt5-small
- SGLang
How to use svogunas/g2p-lt-byt5-small 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 "svogunas/g2p-lt-byt5-small" \ --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": "svogunas/g2p-lt-byt5-small", "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 "svogunas/g2p-lt-byt5-small" \ --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": "svogunas/g2p-lt-byt5-small", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use svogunas/g2p-lt-byt5-small with Docker Model Runner:
docker model run hf.co/svogunas/g2p-lt-byt5-small
YAML Metadata Warning:The pipeline tag "text2text-generation" is not in the official list: text-classification, token-classification, table-question-answering, question-answering, zero-shot-classification, translation, summarization, feature-extraction, text-generation, fill-mask, sentence-similarity, text-to-speech, text-to-audio, automatic-speech-recognition, audio-to-audio, audio-classification, audio-text-to-text, voice-activity-detection, depth-estimation, image-classification, object-detection, image-segmentation, text-to-image, image-to-text, image-to-image, image-to-video, unconditional-image-generation, video-classification, reinforcement-learning, robotics, tabular-classification, tabular-regression, tabular-to-text, table-to-text, multiple-choice, text-ranking, text-retrieval, time-series-forecasting, text-to-video, image-text-to-text, image-text-to-image, image-text-to-video, visual-question-answering, document-question-answering, zero-shot-image-classification, graph-ml, mask-generation, zero-shot-object-detection, text-to-3d, image-to-3d, image-feature-extraction, video-text-to-text, keypoint-detection, visual-document-retrieval, any-to-any, video-to-video, other
g2p-lt-byt5-small — Lithuanian grapheme-to-phoneme (G2P), lite
A byte-level ByT5 model that converts Lithuanian words in standard orthography into their phoneme sequence. This is the lite variant — 300 M params, ~2× faster than the flagship, for edge/embedded use — at a small accuracy cost.
- Input: one word, standard Lithuanian spelling, lowercase — e.g.
labas - Output: space-separated phonemes in the LIEPA-3
phonalphabet — e.g.l a b a s - Architecture:
google/byt5-small(300 M), fully fine-tuned. Byte-level ⇒ no tokenizer issues with Lithuanian letters or phoneme symbols.
For maximum accuracy use the flagship
svogunas/g2p-lt-byt5-base.
Results
Held-out test set of 3,000 words unseen in training (true generalisation):
| decoding | PER | word accuracy |
|---|---|---|
| greedy | 1.98 % | 88.3 % |
| beam = 5 | 1.96 % | 88.5 % |
The flagship base scores 1.88 % / 89.2 % — a 0.1 % PER edge for ~2× the parameters. This small model was trained for 12 epochs (vs 5 for base): the extra epochs help the small model (2.34 % → 1.98 %) where they did not help base or large.
Usage
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
tok = AutoTokenizer.from_pretrained("svogunas/g2p-lt-byt5-small")
model = AutoModelForSeq2SeqLM.from_pretrained("svogunas/g2p-lt-byt5-small")
def g2p(word: str) -> str:
ids = tok(word.lower(), return_tensors="pt").input_ids
out = model.generate(ids, max_length=64) # greedy; add num_beams=5 for a tiny gain
return tok.decode(out[0], skip_special_tokens=True)
print(g2p("labas")) # l a b a s
print(g2p("abaravičiene")) # a b a r a v' i tS' ie n' e
Feed one word at a time (the model is trained on isolated words). For a sentence, split on whitespace, look words up, and handle punctuation/numbers in your own front-end.
Phoneme notation (LIEPA-3 phon alphabet)
Phonemes are space-separated. Conventions:
- Lowercase base symbols for the core sounds.
'after a consonant marks palatalization (Lithuanian minkštumas):v',tS',n'.- Doubled symbols mark length:
aa,oo,ii,ee,uu. - Digraphs for diphthongs/affricates:
ie,uo,ea;tS(č),dZ(dž),ts(c),dz. - Capitalised variants encode stress / length distinctions (e.g.
aA,Aa,Oo,Ea).
Full inventory (~90 symbols) observed in the training lexicon:
a i e s s' n' t' t u oo k m r' n r k' l' p j j' m' I v' p' ee d d' l ii S' E v w
g' g uu U aA o S b' tS' b A Aa Ee Uo Z' aa Oo Ii Ea ea ie z J ts' eA z' Z uo O iI
W uU f' dZ' f oO N iE eE N' Uu Ie R' R uO x h L' ts M' x' h' L M tS dZ dz' dz
Training data
- LIEPA-3 word+phoneme TextGrids (
phon/) + EMO (Lithuanian emotional speech) phoneme annotations, merged into a 233 k-word pronunciation lexicon (one consistent notation, 99.5 % mean cross-source agreement); 3 k words held out for the test above. - Excluded by design: medical (different SAMPA notation) and dialectal (phonetic transcripts).
Fine-tuned from google/byt5-small, 12 epochs, lr 5e-4, load_best_model_at_end on eval loss.
Limitations
- Isolated-word model: no sentence-level context, sandhi, or homograph disambiguation.
- Trained on standard Lithuanian; dialectal pronunciation is out of scope.
License & attribution
Released under CC BY 4.0. Training data (LIEPA-3, EMO) is CC BY 4.0 from VDU / CLARIN-LT — please attribute them when you use this model:
Pronunciation lexicon derived from LIEPA-3 and the VDU Lithuanian emotional speech corpus, distributed via CLARIN-LT (CC BY 4.0).
Citation
@misc{g2p-lt-byt5-small,
title = {g2p-lt-byt5-small: Lithuanian grapheme-to-phoneme (ByT5, lite)},
author = {Smaliukas, Arūnas},
year = {2026},
note = {Fine-tuned from google/byt5-small on a LIEPA-3 + EMO pronunciation lexicon (CC BY 4.0)},
url = {https://huggingface.co/svogunas/g2p-lt-byt5-small}
}
- Downloads last month
- 27
Model tree for svogunas/g2p-lt-byt5-small
Base model
google/byt5-small