Downloads · 30 days
45
41% of all-time downloads
nugjii/mms-tts-mon-fixed
mms-tts-mon-fixed is a text-to-speech model from nugjii. Use it when you need text read aloud. The card lists the license as cc-by-nc-4.0.
A corrected copy of facebook/mms-tts-mon with a fixed tokenizer vocabulary. Model weights are unmodified. The only change is two renamed keys in vocab.json.
Downloads · 30 days
45
41% of all-time downloads
All-time downloads
109
Public
Parameters
36.3M
291 MB on disk
Likes
0
Public
Click a slice to open those files.
.bin145 MB · 50%
From the Hugging Face model README
A corrected copy of facebook/mms-tts-mon
with a fixed tokenizer vocabulary. Model weights are unmodified. The only change is
two renamed keys in vocab.json.
The original vocab.json contains ѳ (U+0473 CYRILLIC SMALL LETTER FITA) and
щ (U+0449 SHCHA) where modern Mongolian uses ө (U+04E9 BARRED O) and
ш (U+0448 SHA). The glyphs are nearly identical; the codepoints are not.
VitsTokenizer filters unmatched characters rather than mapping them to <unk>, so
ө and ш were deleted from the input with no warning:
tok("өвөл")["input_ids"] # [0, 20, 0, 10, 0]
tok("вл")["input_ids"] # [0, 20, 0, 10, 0] <- identical
өвөл ("winter") came out as "вл". Both letters are extremely common in Mongolian, so a
large share of ordinary text was affected.
The two keys are renamed, not added alongside the originals:
| Before | After | ID |
|---|---|---|
ѳ U+0473 | ө U+04E9 | 17 |
щ U+0449 | ш U+0448 | 26 |
Renaming keeps len(vocab) at 64, matching model.config.vocab_size. Adding the modern
characters as extra keys would inflate VitsTokenizer.vocab_size (which is just
len(vocab)) to 66 while the model config stayed at 64. That mismatch breaks the common
model.resize_token_embeddings(len(tokenizer)) fine-tuning pattern, silently resizing the
embedding table.
The embeddings themselves are correct — only the labels were wrong. Vocab IDs are
frequency-ordered, and loan-only letters cluster at the bottom (п=32, к=33, ф=34,
ъ=35) while ѳ=17 and щ=26 sit in the mid-frequency range where common native letters
belong. The likely cause is training text typeset in a pre-Unicode Mongolian font that
reused the fita and shcha codepoints.
Literal ѳ (U+0473) and щ (U+0449) are no longer in the vocabulary and will be dropped.
ѳ is archaic Church Slavonic and appears in no modern Mongolian text — no practical impact.щ occurs in a few Russian loanwords (борщ, Хрущев). If your text contains it, map it
to ш first. The model produced one sound for both in any case, since only one token
ever existed:text = text.replace("щ", "ш").replace("Щ", "Ш")
from transformers import VitsModel, AutoTokenizer
import torch
model = VitsModel.from_pretrained("nugjii/mms-tts-mon-fixed")
tok = AutoTokenizer.from_pretrained("nugjii/mms-tts-mon-fixed")
inputs = tok("Өнөөдөр шинэ өдөр эхэллээ.", return_tensors="pt")
with torch.no_grad():
wav = model(**inputs).waveform
The resulting waveform can be saved as a .wav file:
import scipy
scipy.io.wavfile.write("out.wav", model.config.sampling_rate, wav[0].numpy())
Or displayed in a Jupyter Notebook / Google Colab:
from IPython.display import Audio
Audio(wav, rate=model.config.sampling_rate)
Generation can be tuned via model.noise_scale (default 0.667, acoustic variability),
model.noise_scale_duration (default 0.8, rhythm), and model.speaking_rate
(default 1.0; higher is slower).
from transformers import AutoTokenizer
old = AutoTokenizer.from_pretrained("facebook/mms-tts-mon")
new = AutoTokenizer.from_pretrained("nugjii/mms-tts-mon-fixed")
print(old("өвөл")["input_ids"]) # [0, 20, 0, 10, 0] — ө dropped
print(new("өвөл")["input_ids"]) # ө preserved
print(new.vocab_size) # 64, matches model.config.vocab_size
"2026 оны" → "хоёр мянга хорин зургаан оны". Ordinal suffixes
(-р / -дугаар / -дүгээр) are vowel-harmony conditioned, so this needs real rules
rather than a lookup table.-, | and —. Full stops,
commas and question marks contribute nothing to prosody.CC-BY-NC 4.0, inherited from the base model. Non-commercial use only.
Base model: Meta AI's Massively Multilingual Speech.
Upstream report: https://huggingface.co/facebook/mms-tts-mon/discussions/1#6a9fc8a3559c57d4078b6852