Instructions to use nimaaaAI/MOSS-TTS-Nano-Persian with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nimaaaAI/MOSS-TTS-Nano-Persian with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-to-speech", model="nimaaaAI/MOSS-TTS-Nano-Persian", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("nimaaaAI/MOSS-TTS-Nano-Persian", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
MOSS-TTS-Nano Persian
A Persian (Farsi) fine tune of OpenMOSS-Team/MOSS-TTS-Nano, a compact text to speech model of 117M parameters.
Training code and full write up: github.com/NimaaaAI/MOSS-TTS-Nano-Fine-Tuning
About the base model
MOSS-TTS-Nano is the smallest member of the OpenMOSS MOSS-TTS family. It pairs a compact autoregressive language model with a neural audio codec, MOSS-Audio-Tokenizer-Nano, which turns speech into discrete tokens the model predicts one frame at a time. Roughly 12.5 tokens correspond to one second of audio.
It supports zero shot voice cloning: give it a few seconds of reference audio and it copies that speaker's voice. Persian is one of the 20 languages the family officially supports, but out of the box the Nano model reads Persian text with an audible English or Chinese accent, reflecting the distribution of its training data. At 570 MB in fp32 it runs without a high end GPU.
What this fine tune changes
The accent. Trained on 34,000 Persian clips from Mozilla Common Voice, this checkpoint produces noticeably more native sounding Persian than the base model when given the same reference clip, the same text, and the same seed.
It does not change the model's size, architecture, or its behaviour on long input. See Limitations.
Samples
Both models were given the same reference voice, the same text, and the same seed. Only the weights differ.
Reference voice (English speaker, cloned by both models):
| Text | Base model | This fine tune |
|---|---|---|
| امروز هوا بسیار خوب است. | ||
| لطفاً در را ببندید. | ||
| خواهرم در دانشگاه تهران درس میخواند. |
The reference speaker is English. Both models are cloning that voice while reading Persian, which is what makes the accent difference audible.
Runtime
Runs on CPU or GPU. Add --device cpu or --device cuda to force one; the script picks automatically otherwise.
On a short utterance, end to end time was 24.3s on CPU and 21.4s on a T4. Nearly all of that is model loading, so in a long running process where the model stays resident, per request generation is a few seconds on either.
Usage
Loading the weights:
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
REPO = "nimaaaAI/MOSS-TTS-Nano-Persian"
model = AutoModelForCausalLM.from_pretrained(
REPO, trust_remote_code=True, dtype=torch.float32)
tokenizer = AutoTokenizer.from_pretrained(REPO, trust_remote_code=True)
For end to end synthesis, the simplest path is the base repo's inference script pointed at this checkpoint. The audio tokenizer is downloaded automatically from its Hub id.
git clone https://github.com/OpenMOSS/MOSS-TTS-Nano.git
cd MOSS-TTS-Nano
pip install -r requirements.txt
pip install torchvision==0.22.0 # required for the pinned torch version
python finetuning/verify.py \
--checkpoint nimaaaAI/MOSS-TTS-Nano-Persian \
--audio-tokenizer-pretrained-name-or-path OpenMOSS-Team/MOSS-Audio-Tokenizer-Nano \
--mode voice_clone \
--text "امروز هوا بسیار خوب است." \
--prompt-audio-path reference.wav \
--seed 42 \
--output-audio-path out.wav
reference.wav is a short recording of the voice you want cloned. Its quality matters a great deal, see Limitations.
Useful flags: --max-new-frames caps output length (default 375, roughly 30 seconds), --do-sample 0 switches to greedy decoding, and --seed makes generation reproducible.
Training
| Base model | OpenMOSS-Team/MOSS-TTS-Nano |
| Parameters | 117.3M |
| Data | Mozilla Common Voice Persian v13 (CC0) |
| Clips | 34,000, filtered by up votes and sentence length |
| Examples | 27,880 (23,800 single sentence, 4,080 multiple sentence groups) |
| Epochs | 3 |
| Learning rate | 1e-5, warmup ratio 0.03 |
| Effective batch | 16 (batch 1, grad accum 8, 2 GPUs) |
| Precision | fp32 |
| Hardware | Kaggle T4 x2 |
Roughly 30% of training examples were built by concatenating 2 or 3 clips from the same speaker into a longer utterance, giving the model exposure to speech longer than a single Common Voice sentence.
That same speaker constraint matters. An earlier round built these groups from randomly shuffled clips, which spliced different people into one utterance and taught the model that the voice may change partway through. Fixing it was the single largest quality improvement in the project.
This checkpoint was trained from the base model rather than continued from a previous fine tune. Chaining rounds over overlapping data produced diminishing returns.
Trained on Kaggle's free tier. Full pipeline and per round logs: training notebook.
Limitations
Utterance length is limited to roughly 5 seconds. Measured across the training set at 12.4 frames per second, matching the 12.5 tokens per second documented upstream: median 3.9s, p90 8.6s, max 25s, with 66% of examples under 5 seconds. The model stops generating near the edge of what it has seen. The base model behaves the same way, so this is a property of the corpus and the autoregressive decoder rather than something introduced by this fine tune.
For longer text, split it into short chunks, generate each with the same reference and seed, then concatenate the audio.
Reference audio quality dominates output quality. The same checkpoint and text with a clean studio reference sounds clearly better than with a noisy crowdsourced clip. A 117M parameter model has limited capacity to separate the voice from the room, so it reproduces background noise and microphone character along with the speaker. Use the cleanest single speaker recording you have.
Output is emotionally flat. Common Voice consists of volunteers reading sentences off a screen. There is no emotional variation in the data, so there is none in the model.
For long form Persian synthesis, a larger model handles full passages in a single call and is the better tool. This model's advantage is its small footprint.
Intended use
Short Persian utterances: prompts, notifications, UI voice, dataset bootstrapping, and research into small model TTS. Suitable for experimentation and for environments where a large model is impractical.
Not intended for producing audio of real people without their consent, or for any use that misrepresents a speaker.
License and attribution
Licensed under the Apache License 2.0.
This model is a fine tuned derivative of OpenMOSS-Team/MOSS-TTS-Nano, Copyright (c) OpenMOSS Team, licensed under Apache 2.0. The weights were modified by supervised fine tuning on Persian speech. Repository files inherited from the base model, including modeling_moss_tts_nano.py, configuration_moss_tts_nano.py, gpt2_decoder.py, and tokenization_moss_tts_nano.py, remain under the same license.
Training data: Mozilla Common Voice, Persian, CC0 public domain.
Not affiliated with or endorsed by the OpenMOSS Team.
Citation
If you use this model, please cite the upstream MOSS-TTS technical report:
@article{moss_tts_2026,
title = {MOSS-TTS Technical Report},
author = {OpenMOSS Team},
journal = {arXiv preprint arXiv:2603.18090},
year = {2026},
url = {https://arxiv.org/abs/2603.18090}
}
For this Persian fine tune specifically:
@misc{saghi2026mosstts_persian,
author = {Saghi, Nima},
title = {MOSS-TTS-Nano Persian},
year = {2026},
publisher = {Hugging Face},
url = {https://huggingface.co/nimaaaAI/MOSS-TTS-Nano-Persian}
}
- Downloads last month
- 92
Model tree for nimaaaAI/MOSS-TTS-Nano-Persian
Base model
OpenMOSS-Team/MOSS-TTS-Nano-100M