mms-tts-mon-fixed

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 problem

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 fix

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.

Breaking change

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("Щ", "Ш")

Usage

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).

Verification

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

Known limitations (inherited from the base model)

  • No text normalization. Digits, dates and currency are not in the vocabulary and get dropped. Expand them yourself before synthesis: "2026 оны""хоёр мянга хорин зургаан оны". Ordinal suffixes ( / -дугаар / -дүгээр) are vowel-harmony conditioned, so this needs real rules rather than a lookup table.
  • No sentence punctuation. The vocabulary contains only -, | and . Full stops, commas and question marks contribute nothing to prosody.
  • 16 kHz mono output. Bandlimited compared to 22.05/24 kHz systems.
  • Narrow prosody. MMS was trained largely on read religious text, and the delivery reflects that.

License

CC-BY-NC 4.0, inherited from the base model. Non-commercial use only.

Credit

Base model: Meta AI's Massively Multilingual Speech.

Upstream report: https://huggingface.co/facebook/mms-tts-mon/discussions/1#6a9fc8a3559c57d4078b6852

Downloads last month
55
Safetensors
Model size
36.3M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for nugjii/mms-tts-mon-fixed

Finetuned
(1)
this model

Paper for nugjii/mms-tts-mon-fixed