Skip to content

Evaluation scripts for the Open TTS Leaderboard: https://huggingface.co/spaces/hf-audio/open_tts_leaderboard

Python

add lfm3-audio, maya, and ming tts (#36)

Eric Bezzam028265db3470
diff --git a/README.md b/README.md
index 2ca1865..adad334 100644
--- a/README.md
+++ b/README.md
@@ -223,7 +223,7 @@ Seamless is fast and batched, so most of each of its generation jobs (~1 min per
> [!TIP]
> **Let your coding agent do the heavy lifting!** Ask it to:
> - make a new folder to evaluate the new model, linking it to a documentation page with usage
-> - use batch inference if possible
+> - use batch inference if possible, with max batch size of 32
> - implement the TTFA probe if the model supports streaming
> - (if you give it permission to your HF account) make a Docker Space to run the model via HF Jobs, taking inspiration from one of the existing configurations [here](https://huggingface.co/collections/bezzam/tts-eval)
diff --git a/higgs/submit_jobs.sh b/higgs/submit_jobs.sh
index 52d470b..3862082 100644
--- a/higgs/submit_jobs.sh
+++ b/higgs/submit_jobs.sh
@@ -64,7 +64,6 @@ DATASET_CONFIGS=(
"zero_shot de de ${CV3_EVAL_PATH:-hf-audio/cv3_eval}"
"zero_shot it it ${CV3_EVAL_PATH:-hf-audio/cv3_eval}"
"zero_shot ru ru ${CV3_EVAL_PATH:-hf-audio/cv3_eval}"
- # MiniMax multilingual (100 sentences/language): the languages the model supports. No `uk`: Qwen3-ASR has no Ukrainian.
"tts en en ${MINIMAX_EVAL_PATH}"
"tts zh zh ${MINIMAX_EVAL_PATH}"
"tts ja ja ${MINIMAX_EVAL_PATH}"
@@ -85,6 +84,7 @@ DATASET_CONFIGS=(
"tts ar ar ${MINIMAX_EVAL_PATH}"
"tts hi hi ${MINIMAX_EVAL_PATH}"
"tts id id ${MINIMAX_EVAL_PATH}"
+ "tts th th ${MINIMAX_EVAL_PATH}"
"tts vi vi ${MINIMAX_EVAL_PATH}"
)
diff --git a/lfm3-audio/run_eval.py b/lfm3-audio/run_eval.py
new file mode 100644
index 0000000..3fd5e5b
--- /dev/null
+++ b/lfm3-audio/run_eval.py
@@ -0,0 +1,274 @@
+"""
+TTS synthesis for the Open TTS Leaderboard (LFM3-Audio backend, stage 1).
+
+LFM3-Audio-2B (LiquidAI/LFM3-Audio-2B) is Liquid AI's end-to-end speech + text model: an LFM3
+backbone predicts 12 LiquidCodec codes per 80 ms speech frame, which the LiquidCodec tokenizer
+(`processor.audio_tokenizer`) turns into 24 kHz audio. It is loaded through Transformers with the
+checkpoint's own code (`trust_remote_code=True`). TTS is selected by the system prompt
+"Perform TTS in <language> using a <gender> voice.", with the assistant turn prefilled with
+`<|audio_start|>`. There is no voice cloning: the voice is one of two built-in ones (female/male).
+
+`model.generate` takes a batch of left-padded prompts and returns every row's speech codes
+(`audio_codes`, padded with -1, cut at `audio_lengths`), so texts are synthesized in minibatches.
+Each row's codes are decoded separately inside the timed region (generation + decoding = RTFx).
+
+Model card (usage): https://huggingface.co/LiquidAI/LFM3-Audio-2B
+
+Stage 2 (`transformers/transcribe.py`, run in the shared `bezzam/evals` image) transcribes the
+wavs with Qwen3-ASR to fill `pred_text`, and stage 4 (`normalizer.eval_utils.score_results`, run
+locally) computes WER + RTFx from the completed manifest. Fixed voice, so no stage 3 (SIM).
+"""
+
+import argparse
+import os
+import sys
+import time
+
+import numpy as np
+import soundfile as sf
+import torch
+from tqdm import tqdm
+from transformers import AutoModelForMultimodalLM, AutoProcessor
+from transformers.generation.streamers import BaseStreamer
+
+from run_eval_utils import (
+ add_common_args, load_done_entries, load_tts_dataset, manifest_entry, open_manifest, output_paths,
+ pending_batches, print_model_size, print_next_steps, set_seed, warm_up, wav_rel_path, write_entry,
+)
+
+# LiquidCodec decodes every 80 ms frame to 1920 samples at 24 kHz.
+SAMPLING_RATE = 24_000
+
+# Dataset split → the language (or locale) named in the TTS system prompt (model card, "Speech
+# languages / locales"). Splits not listed here are not supported by the model.
+LANGUAGES = {
+ "en": "American English",
+ "zh": "Chinese",
+ "ja": "Japanese",
+ "ko": "Korean",
+ "fr": "French",
+ "de": "German",
+ "es": "Spanish",
+ "it": "Italian",
+ "pt": "Portuguese",
+ "nl": "Dutch",
+ "pl": "Polish",
+ "el": "Greek",
+ "fi": "Finnish",
+ "tr": "Turkish",
+ "ar": "Arabic",
+ "da": "Danish",
+ "he": "Hebrew",
+ "sv": "Swedish",
+}
+
+
+class _StopAfterFirstAudio(Exception):
+ """Raised from the TTFA streamer to abort generation once the first audio is in hand."""
+
+
+class FirstAudioStreamer(BaseStreamer):
+ """TTFA probe only: decodes the first `n_frames` speech frames the moment they are sampled.
+
+ `model.generate` hands every speech frame, `(num_codebooks,)`, to `put` synchronously, and the
+ codec decodes chunk by chunk through a `LiquidCodecStreamingCache`, so the first chunk's audio
+ is exactly what a streaming client could start playing.
+ """
+
+ def __init__(self, codec, n_frames, early_stop):
+ self.codec, self.n_frames, self.early_stop = codec, n_frames, early_stop
+ self.frames, self.first, self.chunk = [], None, None
+
+ def put(self, value):
+ self.frames.append(value)
+ if self.first is None and len(self.frames) == self.n_frames:
+ # The cache class lives in the codec's remote-code module (modeling_liquid_codec.py).
+ cache = sys.modules[type(self.codec).__module__].LiquidCodecStreamingCache(self.codec.config)
+ codes = torch.stack(self.frames, -1).unsqueeze(0) # (1, num_codebooks, n_frames)
+ self.chunk = self.codec.decode(codes, streaming_cache=cache, finalize=False).audio_values[0]
+ self.chunk = self.chunk.float().cpu().numpy() # .cpu() syncs: the audio is in hand
+ self.first = time.perf_counter()
+ if self.early_stop:
+ raise _StopAfterFirstAudio
+
+ def end(self):
+ pass
+
+
+def main(args):
+ set_seed(args.seed)
+
+ if args.split not in LANGUAGES:
+ raise ValueError(f"LFM3-Audio has no TTS language for split '{args.split}'.")
+ language = args.language or LANGUAGES[args.split]
+ system_prompt = f"Perform TTS in {language} using a {args.voice} voice."
+
+ dtype = torch.bfloat16 if args.device.startswith("cuda") else torch.float32
+ model = AutoModelForMultimodalLM.from_pretrained(
+ args.model_id, dtype=dtype, device_map=args.device, trust_remote_code=True
+ ).eval()
+ processor = AutoProcessor.from_pretrained(args.model_id, trust_remote_code=True)
+ processor.tokenizer.padding_side = "left" # generate() expects left-padded prompts
+ codec = processor.audio_tokenizer.to(device=args.device).eval()
+ print(f"Loaded LFM3-Audio ({args.model_id}): system prompt {system_prompt!r}")
+ print_model_size(model, codec)
+
+ sampling = dict(
+ max_new_tokens=args.max_new_tokens,
+ audio_temperature=args.audio_temperature,
+ audio_top_k=args.audio_top_k,
+ audio_repetition_penalty=args.audio_repetition_penalty,
+ audio_repetition_window=args.audio_repetition_window,
+ return_dict_in_generate=True,
+ )
+ truncated = [] # rows that hit --max_new_tokens before the end-of-audio frame
+
+ def prompts(texts):
+ """Left-padded TTS prompts for a batch of texts, ending on `<|audio_start|>`."""
+ conversations = [
+ [
+ {"role": "system", "content": system_prompt},
+ {"role": "user", "content": text},
+ {"role": "assistant", "content": "<|audio_start|>"},
+ ]
+ for text in texts
+ ]
+ return processor.apply_chat_template(
+ conversations, continue_final_message=True, tokenize=True, return_dict=True,
+ return_tensors="pt", processor_kwargs={"padding": True},
+ ).to(args.device)
+
+ def decode(codes):
+ """(num_codebooks, frames) codes of one row → 1-D float32 numpy waveform."""
+ if not codes.shape[-1]:
+ return np.zeros(1, dtype=np.float32)
+ audio = codec.decode(codes.unsqueeze(0)).audio_values[0]
+ return audio.float().cpu().numpy()
+
+ @torch.inference_mode()
+ def generate_tts(texts):
+ """Synthesize a batch of texts; time generation + decoding for RTFx.
+
+ Returns (list of 1-D float32 audio arrays, per-sample time in seconds).
+ """
+ inputs = prompts(texts) # tokenization is text preprocessing, not generation
+
+ # START TIMING (batched generation + codec decoding)
+ if args.device.startswith("cuda"):
+ torch.cuda.synchronize(args.device)
+ start = time.perf_counter()
+ outputs = model.generate(**inputs, **sampling)
+ audios = []
+ for row, text in enumerate(texts):
+ length = int(outputs.audio_lengths[row])
+ audios.append(decode(outputs.audio_codes[row, :, :length]))
+ if length >= args.max_new_tokens:
+ truncated.append(text)
+ # END TIMING (decode() ends with .cpu(), so the audio is materialised)
+ elapsed = time.perf_counter() - start
+ return audios, elapsed / len(texts)
+
+ # Layout: results/<model_safe>/{MODEL_<safe>_DATASET_<dsid>.jsonl, <dsid>/output_<id>.wav}.
+ # Manifest paths are relative to model_dir so later stages resolve them wherever it is copied.
+ paths = output_paths(args)
+ model_dir, dataset_dir_name, manifest_path = paths.model_dir, paths.dataset_dir_name, paths.manifest_path
+
+ dataset = load_tts_dataset(args)
+
+ # ── TTFA probe: latency only, writing nothing but a JSON sidecar ─────────
+ # Batch size 1; the first audio is the first `--ttfa_chunk_frames` frames decoded as soon as
+ # they are sampled (FirstAudioStreamer). The rest of the utterance is decoded at the end.
+ # 0 = off; N > 0 = N evenly spaced samples; N < 0 = the whole split (see scripts/ttfa_probe.py).
+ if args.ttfa_probe != 0:
+ # Imported here: ttfa_probe.py is injected only by submit_ttfa_jobs.sh.
+ from ttfa_probe import run_probe, sample_indices
+
+ @torch.inference_mode()
+ def _ttfa_gen(job, early_stop):
+ streamer = FirstAudioStreamer(codec, args.ttfa_chunk_frames, early_stop)
+ try:
+ outputs = model.generate(**prompts([job["text"]]), audio_streamer=streamer, **sampling)
+ except _StopAfterFirstAudio:
+ return streamer.chunk, SAMPLING_RATE, streamer.first
+ audio = decode(outputs.audio_codes[0, :, : int(outputs.audio_lengths[0])])
+ # Shorter than one chunk: the first audio is the whole utterance.
+ return audio, SAMPLING_RATE, streamer.first or time.perf_counter()
+
+ # The probe discards its first rows as warm-up but does not run one: compile the kernels
+ # here so the first probed rows are not dominated by CUDA initialisation.
+ for i in range(min(args.warmup_steps, len(dataset))):
+ generate_tts([dataset[i][args.text_column]])
+ set_seed(args.seed)
+
+ run_probe(
+ _ttfa_gen,
+ [{"text": dataset[i][args.text_column]} for i in sample_indices(args.ttfa_probe, len(dataset))],
+ model_id=args.model_id, dataset_path=args.dataset_path,
+ dataset_config=args.dataset, split=args.split,
+ out_dir=model_dir, n=args.ttfa_probe,
+ # The chunk size is the floor under TTFA, so it is recorded with the numbers.
+ extra={"device": args.device, "voice": args.voice, "ttfa_chunk_frames": args.ttfa_chunk_frames},
+ )
+ return
+
+ done_entries = load_done_entries(manifest_path, args.resume)
+ manifest_file = open_manifest(manifest_path, done_entries)
+
+ def run_batch(batch):
+ return generate_tts(list(batch[args.text_column]))
+
+ # ── Main loop: TTS → write JSONL, one batch at a time ───────────────────
+ starts = pending_batches(dataset, args.batch_size, done_entries, dataset_dir_name)
+ warm_up(run_batch, dataset, starts, args.batch_size, args.warmup_steps)
+ set_seed(args.seed) # so warm-up does not shift the RNG stream of the timed run
+ truncated.clear()
+
+ for batch_start in tqdm(starts, desc="Generating"):
+ batch = dataset[batch_start : batch_start + args.batch_size]
+ texts = list(batch[args.text_column])
+ audios, per_sample_time = run_batch(batch)
+
+ for sample_id, text, audio in zip(batch["id"], texts, audios):
+ # Store the path relative to model_dir (the manifest's dir); write to the full path.
+ rel_path = wav_rel_path(dataset_dir_name, sample_id)
+ sf.write(os.path.join(model_dir, rel_path), audio, SAMPLING_RATE)
+ write_entry(manifest_file, manifest_entry(rel_path, len(audio) / SAMPLING_RATE, per_sample_time, text))
+ manifest_file.flush()
+
+ manifest_file.close()
+ if truncated:
+ print(f"WARNING: {len(truncated)} sample(s) hit --max_new_tokens={args.max_new_tokens} "
+ "before the end-of-audio frame (audio cut off).")
+ print("Results saved at path:", os.path.abspath(manifest_path))
+ print_next_steps(voice_clone=False)
+
+
+if __name__ == "__main__":
+ parser = argparse.ArgumentParser()
+
+ parser.add_argument("--model_id", type=str, default="LiquidAI/LFM3-Audio-2B", help="LFM3-Audio repo id.")
+ parser.add_argument("--voice", type=str, default="female", choices=["female", "male"],
+ help="Built-in voice (selected through the system prompt).")
+ parser.add_argument("--language", type=str, default=None,
+ help="Language/locale named in the system prompt (default: from --split, see "
+ "LANGUAGES), e.g. 'British English'.")
+ # Speech sampling settings from the model card ("Audio sampling parameters").
+ parser.add_argument("--audio_temperature", type=float, default=1.0, help="Speech-code sampling temperature.")
+ parser.add_argument("--audio_top_k", type=int, default=128, help="Speech-code top-k.")
+ parser.add_argument("--audio_repetition_penalty", type=float, default=1.1, help="Speech-code repetition penalty.")
+ parser.add_argument("--audio_repetition_window", type=int, default=4096,
+ help="Past speech frames covered by the repetition penalty.")
+ # 1 frame = 80 ms of audio, so 1024 frames is ~82 s: far beyond any eval utterance.
+ parser.add_argument("--max_new_tokens", type=int, default=1024,
+ help="Max generated slots (speech frames) per sample.")
+ parser.add_argument("--ttfa_chunk_frames", type=int, default=1,
+ help="TTFA probe: frames (80 ms each) decoded for the first playable chunk.")
+ add_common_args(parser, batch_size=32)
+
+ args = parser.parse_args()
+
+ print("*" * 100)
+ print(f"Generating TTS with {args.model_id} on {args.dataset_path} / {args.dataset} / {args.split}")
+ print("*" * 100)
+
+ main(args)
diff --git a/lfm3-audio/submit_jobs.sh b/lfm3-audio/submit_jobs.sh
new file mode 100644
index 0000000..b3e909e
--- /dev/null
+++ b/lfm3-audio/submit_jobs.sh
@@ -0,0 +1,76 @@
+#!/bin/bash
+# HF Jobs TTS eval — LFM3-Audio backend (fixed voice → generate → transcribe → UTMOS → score).
+# Runs locally; submits HF Jobs. Usage: HF_TOKEN=hf_... bash submit_jobs.sh ["LiquidAI/LFM3-Audio-2B 32" ...]
+# Shared orchestration (stages 2/3, injection, logging, scoring) lives in scripts/tts_jobs_common.sh.
+source "$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)/scripts/tts_jobs_common.sh"
+
+# ── Backend config ───────────────────────────────────────────────────────────
+TTS_SPACE="${TTS_SPACE:-bezzam/evals-lfm3-audio}" # stage-1 image (Dockerfile in the Space: https://huggingface.co/spaces/bezzam/evals-lfm3-audio/blob/main/Dockerfile)
+# gen FLAVOR (h200) is set centrally in tts_jobs_common.sh for RTFx comparability — don't override.
+DEFAULT_STAGES="generate transcribe utmos" # no SIM (fixed voice)
+RUN_EVAL_INJECT="$(inject_run_eval)"
+
+# Two built-in voices (female/male), picked by the system prompt; no voice cloning.
+LFM_VOICE="${LFM_VOICE:-female}"
+
+# ── Stage 1: TTS generation. MODEL_CFG = "model_id batch_size". ──
+generate_stage() {
+ local _ BATCH_SIZE
+ read -r _ BATCH_SIZE <<< "${MODEL_CFG}"
+ hf jobs run \
+ --flavor "${FLAVOR}" --timeout 8h --secrets HF_TOKEN ${NAMESPACE_ARG} \
+ --volume "hf://buckets/${RESULTS_BUCKET}:/results" "${TTS_IMAGE}" \
+ bash -c "
+ ${RUN_EVAL_INJECT}
+ cd /app/lfm3-audio && python run_eval.py \
+ --model_id=${MODEL_ID} \
+ --voice=${LFM_VOICE} \
+ --dataset_path=${DATASET_PATH} \
+ --dataset=${DATASET} \
+ --split=${SPLIT} \
+ --device=cuda:0 \
+ --batch_size=${BATCH_SIZE} \
+ --max_eval_samples=${MAX_EVAL_SAMPLES} &&
+ mkdir -p /results &&
+ cp -r results/${MODEL_SAFE} /results/
+ "
+}
+
+# ── Datasets: "config split asr_language [dataset_path]" (comment/uncomment) ──
+# The languages of each benchmark that the model speaks (model card: 18 languages; see LANGUAGES
+# in run_eval.py). Without a 4th field the line uses DEFAULT_DATASET_PATH (hf-audio/seed_tts_eval).
+DATASET_CONFIGS=(
+ "tts en en"
+ "tts zh zh"
+ "zero_shot en en ${CV3_EVAL_PATH}"
+ "zero_shot zh zh ${CV3_EVAL_PATH}"
+ "zero_shot fr fr ${CV3_EVAL_PATH}"
+ "zero_shot es es ${CV3_EVAL_PATH}"
+ "zero_shot ja ja ${CV3_EVAL_PATH}"
+ "zero_shot ko ko ${CV3_EVAL_PATH}"
+ "zero_shot de de ${CV3_EVAL_PATH}"
+ "zero_shot it it ${CV3_EVAL_PATH}"
+ "tts en en ${MINIMAX_EVAL_PATH}"
+ "tts zh zh ${MINIMAX_EVAL_PATH}"
+ "tts ja ja ${MINIMAX_EVAL_PATH}"
+ "tts ko ko ${MINIMAX_EVAL_PATH}"
+ "tts fr fr ${MINIMAX_EVAL_PATH}"
+ "tts de de ${MINIMAX_EVAL_PATH}"
+ "tts es es ${MINIMAX_EVAL_PATH}"
+ "tts it it ${MINIMAX_EVAL_PATH}"
+ "tts pt pt ${MINIMAX_EVAL_PATH}"
+ "tts nl nl ${MINIMAX_EVAL_PATH}"
+ "tts pl pl ${MINIMAX_EVAL_PATH}"
+ "tts el el ${MINIMAX_EVAL_PATH}"
+ "tts fi fi ${MINIMAX_EVAL_PATH}"
+ "tts tr tr ${MINIMAX_EVAL_PATH}"
+ "tts ar ar ${MINIMAX_EVAL_PATH}"
+)
+
+# ── Models: "model_id batch_size" (CLI args override) ────────────────────────
+MODEL_CONFIGS=(
+ "LiquidAI/LFM3-Audio-2B 32"
+)
+[[ $# -gt 0 ]] && MODEL_CONFIGS=("$@")
+
+run_pipeline
diff --git a/maya2/run_eval.py b/maya2/run_eval.py
new file mode 100644
index 0000000..e606712
--- /dev/null
+++ b/maya2/run_eval.py
@@ -0,0 +1,210 @@
+"""
+TTS synthesis for the Open TTS Leaderboard (Maya 2 Native backend, stage 1).
+
+Maya 2 Native (maya-research/maya2-native) is a Qwen3-1.7B backbone that predicts the first Mimi
+codebook of each 80 ms frame, with a depth decoder filling the other 31; Mimi decodes the frames
+into 24 kHz audio. It targets 11 Indian languages and English. The Hub repo only holds the weights;
+inference uses the `maya3` engine of the pinned GitHub repo (https://github.com/MayaResearch/maya2-native),
+installed in the Docker image. Model card (usage): https://huggingface.co/maya-research/maya2-native
+
+The engine does continuous batching: requests submitted together share up to `max_seats` decoding
+seats. A minibatch of `--batch_size` rows is therefore submitted at once (`max_seats` =
+`--batch_size`) and timed from submission until its last request ends. The engine splits long
+text itself (~20 s pieces) and seeds sampling with its fixed default seed.
+
+Text goes through the engine's bundled normalizer first (`normalize=True`, which the model card
+requires for the Python API: digits, currency, dates, ...).
+
+- `--voice_clone`: each row's `prompt_audio`/`prompt_text` becomes a one-off voice (`icl_spk`: the
+ reference clip's Mimi codes in context + its ECAPA speaker embedding), built inside the timed
+ region. The reference is in the target language in every benchmark here.
+- default (`--no-voice_clone`): a built-in voice (`--voice`, default Ahana, trained on English and
+ Hindi among others); no SIM.
+
+Stage 2 (`transformers/transcribe.py`) fills `pred_text` with Qwen3-ASR; stage 3
+(`transformers/score_similarity.py`, voice-clone only) fills `sim`; stage 4
+(`normalizer.eval_utils.score_results`) computes WER + RTFx (+ mean SIM).
+"""
+
+import argparse
+import os
+import threading
+import time
+
+import numpy as np
+import soundfile as sf
+import torch
+from tqdm import tqdm
+
+from run_eval_utils import (
+ add_common_args, load_done_entries, load_tts_dataset, manifest_entry, open_manifest, output_paths,
+ pending_batches, print_model_size, print_next_steps, set_seed, warm_up, wav_rel_path, write_entry,
+)
+
+SAMPLING_RATE = 24_000 # Mimi
+# The model's languages (model card). Only en and hi overlap with the leaderboard's benchmarks.
+LANGUAGES = {"as", "bn", "en", "gu", "hi", "kn", "ml", "mr", "or", "pa", "ta", "te"}
+
+
+def main(args):
+ from maya3 import Maya3TTS
+ from maya3.text import normalise_text
+
+ if args.split not in LANGUAGES:
+ raise ValueError(f"Maya 2 Native does not speak split '{args.split}'.")
+
+ set_seed(args.seed)
+ tts = Maya3TTS.from_pretrained(args.model_id, device=args.device, max_seats=args.batch_size)
+ engine = tts.engine
+ print(f"Loaded Maya 2 Native ({args.model_id}, max_seats={args.batch_size}, voice="
+ f"{'clone' if args.voice_clone else args.voice})")
+ print_model_size(*(m for m in (getattr(engine, "model", None), getattr(engine, "mimi", None))
+ if isinstance(m, torch.nn.Module)))
+ if not args.voice_clone and args.voice not in tts.voices:
+ raise ValueError(f"Unknown voice {args.voice!r}; built-in voices: {sorted(tts.voices)}")
+
+ def run_requests(texts, voices):
+ """Submit every text at once (continuous batching); wait for all. Return per-row float32 audio."""
+ chunks = [[] for _ in texts]
+ done = [threading.Event() for _ in texts]
+ errors = []
+
+ def on_event(row):
+ def handle(kind, payload):
+ if kind == "audio":
+ chunks[row].append(payload)
+ else: # 'end' or 'error'
+ if kind == "error":
+ errors.append(payload)
+ done[row].set()
+ return handle
+
+ for row, (text, voice) in enumerate(zip(texts, voices)):
+ engine.submit(normalise_text(text, args.split), args.split, voice, on_event=on_event(row))
+ for event in done:
+ if not event.wait(args.request_timeout):
+ raise TimeoutError(f"a request did not finish within {args.request_timeout} s")
+ if errors:
+ raise RuntimeError(f"generation failed: {errors[0]}")
+ return [np.concatenate(c).astype(np.float32) / 32767.0 if c else np.zeros(1, np.float32) for c in chunks]
+
+ def generate_tts(texts, prompt_paths=None, prompt_texts=None):
+ """Synthesize a batch; time voice building (cloning) + generation. Return (audios, per-sample s)."""
+ torch.cuda.synchronize(args.device)
+ start = time.perf_counter()
+ if args.voice_clone:
+ voices = [tts.make_voice(f"ref-{i}", ref_audio=path, ref_text=ref_text, lang=args.split)
+ for i, (path, ref_text) in enumerate(zip(prompt_paths, prompt_texts))]
+ else:
+ voices = [engine.registry.get(args.voice)] * len(texts)
+ audios = run_requests(texts, voices) # PCM arrives on the CPU: the audio is in hand
+ elapsed = time.perf_counter() - start
+ return audios, elapsed / len(texts)
+
+ # Layout: results/<model_safe>/{manifest.jsonl, <dsid>/output_<id>.wav}; manifest paths are
+ # relative to model_dir. The two modes' audio is kept apart so they don't overwrite each other.
+ mode_suffix = "_voice_clone" if args.voice_clone else ""
+ paths = output_paths(args, mode_suffix)
+ model_dir, dataset_dir_name, manifest_path = paths.model_dir, paths.dataset_dir_name, paths.manifest_path
+ if args.voice_clone:
+ os.makedirs(os.path.join(paths.output_dir, "prompts"), exist_ok=True)
+
+ dataset = load_tts_dataset(args, ("prompt_text", "prompt_audio") if args.voice_clone else ())
+
+ # ── TTFA probe: latency only, writing nothing but a JSON sidecar ─────────
+ # Batch size 1, built-in voice; the engine streams PCM per frame, so the first chunk is the
+ # first playable audio.
+ # 0 = off; N > 0 = N evenly spaced samples; N < 0 = the whole split (see scripts/ttfa_probe.py).
+ if args.ttfa_probe != 0:
+ if args.voice_clone:
+ raise ValueError("The TTFA probe runs with a built-in voice; drop --voice_clone.")
+ # Imported here: ttfa_probe.py is injected only by submit_ttfa_jobs.sh.
+ from ttfa_probe import run_probe, sample_indices
+
+ def _ttfa_gen(job, early_stop):
+ chunks, first = [], None
+ # stream() cancels the request when the generator is closed (early stop).
+ for chunk in tts.stream(job["text"], lang=args.split, voice=args.voice, normalize=True):
+ if first is None:
+ first = time.perf_counter()
+ if early_stop:
+ return chunk, SAMPLING_RATE, first
+ chunks.append(chunk)
+ return np.concatenate(chunks) if chunks else np.zeros(1), SAMPLING_RATE, first
+
+ # The probe discards its first rows as warm-up but does not run one: compile the kernels
+ # here so the first probed rows are not dominated by CUDA initialisation.
+ for i in range(min(args.warmup_steps, len(dataset))):
+ generate_tts([dataset[i][args.text_column]])
+
+ run_probe(
+ _ttfa_gen,
+ [{"text": dataset[i][args.text_column]} for i in sample_indices(args.ttfa_probe, len(dataset))],
+ model_id=args.model_id, dataset_path=args.dataset_path,
+ dataset_config=args.dataset, split=args.split,
+ out_dir=model_dir, n=args.ttfa_probe,
+ extra={"device": args.device, "voice": args.voice},
+ )
+ tts.close()
+ return
+
+ done_entries = load_done_entries(manifest_path, args.resume)
+ manifest_file = open_manifest(manifest_path, done_entries)
+
+ def write_prompt(sample_id, prompt_audio):
+ """Write a cloning reference to a wav (the engine reads it from a path; stage 3 scores against it).
+
+ Returns (path relative to model_dir, full path). Done outside the timed region.
+ """
+ rel = os.path.join(dataset_dir_name, "prompts", f"prompt_{sample_id}.wav")
+ full = os.path.join(model_dir, rel)
+ if not os.path.exists(full):
+ sf.write(full, np.asarray(prompt_audio["array"], dtype=np.float32), prompt_audio["sampling_rate"])
+ return rel, full
+
+ def run_batch(batch):
+ """Synthesize one minibatch. Return (audios, per-sample time, prompt paths relative to model_dir)."""
+ texts = list(batch[args.text_column])
+ if not args.voice_clone:
+ return (*generate_tts(texts), [None] * len(texts))
+ prompts = [write_prompt(sid, audio) for sid, audio in zip(batch["id"], batch["prompt_audio"])]
+ audios, per_sample = generate_tts(texts, [full for _, full in prompts], list(batch["prompt_text"]))
+ return audios, per_sample, [rel for rel, _ in prompts]
+
+ # ── Main loop: TTS → write JSONL, one batch at a time ───────────────────
+ starts = pending_batches(dataset, args.batch_size, done_entries, dataset_dir_name)
+ warm_up(run_batch, dataset, starts, args.batch_size, args.warmup_steps)
+
+ for batch_start in tqdm(starts, desc="Generating"):
+ batch = dataset[batch_start : batch_start + args.batch_size]
+ audios, per_sample_time, prompt_rels = run_batch(batch)
+
+ for sample_id, text, audio, prompt_rel in zip(batch["id"], batch[args.text_column], audios, prompt_rels):
+ # Store the path relative to model_dir (the manifest's dir); write to the full path.
+ rel_path = wav_rel_path(dataset_dir_name, sample_id)
+ sf.write(os.path.join(model_dir, rel_path), audio, SAMPLING_RATE)
+ write_entry(manifest_file, manifest_entry(rel_path, len(audio) / SAMPLING_RATE, per_sample_time, text, prompt_rel))
+ manifest_file.flush()
+
+ manifest_file.close()
+ tts.close()
+ print("Results saved at path:", os.path.abspath(manifest_path))
+ print_next_steps(args.voice_clone)
+
+
+if __name__ == "__main__":
+ parser = argparse.ArgumentParser()
+
+ parser.add_argument("--model_id", type=str, default="maya-research/maya2-native", help="Maya 2 Native repo id.")
+ parser.add_argument("--voice", type=str, default="Ahana",
+ help="Built-in voice without --voice_clone (model card 'Voices'; Ahana is trained on English and Hindi).")
+ parser.add_argument("--request_timeout", type=float, default=600, help="Seconds to wait for one batch's requests.")
+ add_common_args(parser, batch_size=32, voice_clone=False)
+
+ args = parser.parse_args()
+
+ print("*" * 100)
+ print(f"Generating TTS with {args.model_id} on {args.dataset_path} / {args.dataset} / {args.split}")
+ print("*" * 100)
+
+ main(args)
diff --git a/maya2/submit_jobs.sh b/maya2/submit_jobs.sh
new file mode 100644
index 0000000..e4454fe
--- /dev/null
+++ b/maya2/submit_jobs.sh
@@ -0,0 +1,58 @@
+#!/bin/bash
+# HF Jobs TTS eval — Maya 2 Native backend (generate → transcribe → SIM* → score; *voice-clone only).
+# Runs locally; submits HF Jobs. Usage: HF_TOKEN=hf_... bash submit_jobs.sh ["maya-research/maya2-native 32" ...]
+# Shared orchestration (stages 2/3, injection, logging, scoring) lives in scripts/tts_jobs_common.sh.
+source "$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)/scripts/tts_jobs_common.sh"
+
+# ── Backend config ───────────────────────────────────────────────────────────
+TTS_SPACE="${TTS_SPACE:-bezzam/evals-maya2}" # stage-1 image (Dockerfile in the Space: https://huggingface.co/spaces/bezzam/evals-maya2/blob/main/Dockerfile)
+# gen FLAVOR (h200) is set centrally in tts_jobs_common.sh for RTFx comparability — don't override.
+RUN_EVAL_INJECT="$(inject_run_eval)"
+
+# VOICE_CLONE=true: zero-shot voice cloning + SIM; false (default) = a built-in voice (MAYA_VOICE).
+SUPPORTS_VOICE_CLONE=true
+MAYA_VOICE="${MAYA_VOICE:-Ahana}"
+
+# 11 Indian languages + English (model card); of the benchmarks' languages only en and hi.
+supports_language() { [[ "$1" == en || "$1" == hi ]]; }
+
+# ── Stage 1: TTS generation. MODEL_CFG = "model_id batch_size" (batch = the engine's max_seats). ──
+generate_stage() {
+ local _ BATCH_SIZE
+ read -r _ BATCH_SIZE <<< "${MODEL_CFG}"
+ hf jobs run \
+ --flavor "${FLAVOR}" --timeout 8h --secrets HF_TOKEN ${NAMESPACE_ARG} \
+ --volume "hf://buckets/${RESULTS_BUCKET}:/results" "${TTS_IMAGE}" \
+ bash -c "
+ ${RUN_EVAL_INJECT}
+ cd /app/maya2 && python run_eval.py \
+ --model_id=${MODEL_ID} \
+ --voice=${MAYA_VOICE} \
+ --dataset_path=${DATASET_PATH} \
+ --dataset=${DATASET} \
+ --split=${SPLIT} \
+ --device=cuda:0 \
+ --batch_size=${BATCH_SIZE} \
+ --max_eval_samples=${MAX_EVAL_SAMPLES} \
+ ${VOICE_CLONE_FLAG} &&
+ mkdir -p /results &&
+ cp -r results/${MODEL_SAFE} /results/
+ "
+}
+
+# ── Datasets: "config split asr_language [dataset_path]" (comment/uncomment) ──
+# Without a 4th field the line uses DEFAULT_DATASET_PATH (hf-audio/seed_tts_eval).
+DATASET_CONFIGS=(
+ "tts en en"
+ "zero_shot en en ${CV3_EVAL_PATH}"
+ "tts en en ${MINIMAX_EVAL_PATH}"
+ "tts hi hi ${MINIMAX_EVAL_PATH}"
+)
+
+# ── Models: "model_id batch_size" (CLI args override) ────────────────────────
+MODEL_CONFIGS=(
+ "maya-research/maya2-native 32"
+)
+[[ $# -gt 0 ]] && MODEL_CONFIGS=("$@")
+
+run_pipeline
diff --git a/ming-tts/run_eval.py b/ming-tts/run_eval.py
new file mode 100644
index 0000000..9db8127
--- /dev/null
+++ b/ming-tts/run_eval.py
@@ -0,0 +1,236 @@
+"""
+TTS synthesis for the Open TTS Leaderboard (Ming-3.0-tts backend, stage 1).
+
+Ming-3.0-tts-0.5B (inclusionAI/Ming-3.0-tts-0.5B) is a dense Qwen2.5-0.5B backbone with a
+flow-matching (DiT) head: each autoregressive step samples a patch of continuous audio latents,
+which a VAE audio tokenizer decodes into 44.1 kHz audio. The Hub repo only holds the checkpoint;
+inference uses the `ming_tts.MingTTS` API of the pinned GitHub repo
+(https://github.com/inclusionAI/Ming-3.0-tts), installed in the Docker image.
+
+Two modes, both through `MingTTS.synthesize` with `raw_text=True` (the text in one piece, without
+text normalization or splitting — how the model's published benchmarks were run):
+- `--voice_clone`: the `TTS` task cloning each sample's `prompt_audio`/`prompt_text`, with the
+ CAM++ speaker embedding (`use_spk_emb`). The reference's trailing silence is trimmed first (Ming's
+ own `trim_trailing_silence`): the tail of the reference seeds the first decode step, and the
+ MiniMax references end in ~1 s of silence, which made the model stop at once (French: 0.3 s
+ outputs, 99% WER on 8 rows; 3.5% trimmed).
+- default (`--no-voice_clone`): the `IP` task with a built-in voice (no SIM; see VOICES). The
+ documented built-in voices are English and Chinese; the other five languages use the English
+ voice with `language_id` (cross-lingual; on 8 MiniMax rows each: de 0%, es 3.4%, fr 3.5% WER,
+ ko 1.0%, ja 8.6% CER).
+
+Both modes cover Chinese, English, German, Spanish, French, Korean and Japanese; the last five pass
+`language_id`, which the model requires for them.
+
+Generation is batch-1 only (the model's own code assumes it), so rows are processed serially. The
+timed region covers what `synthesize` does per row: reference loading + encoding (voice cloning),
+autoregressive sampling and decoding.
+
+Stage 2 (`transformers/transcribe.py`) fills `pred_text` with Qwen3-ASR; stage 3
+(`transformers/score_similarity.py`, voice-clone only) fills `sim`; stage 4
+(`normalizer.eval_utils.score_results`) computes WER + RTFx (+ mean SIM).
+"""
+
+import argparse
+import os
+import sys
+import time
+
+import numpy as np
+import soundfile as sf
+import torch
+from tqdm import tqdm
+
+from run_eval_utils import (
+ add_common_args, load_done_entries, load_tts_dataset, manifest_entry, open_manifest, output_paths,
+ pending_batches, print_model_size, print_next_steps, set_seed, warm_up, wav_rel_path, write_entry,
+)
+
+# Languages that need an explicit `language_id` (tts_tasks.MULTILINGUAL_LANGUAGE_IDS); Chinese and
+# English work without one.
+MULTILINGUAL = {"ja", "ko", "de", "fr", "es"}
+LANGUAGES = {"en", "zh"} | MULTILINGUAL
+# Built-in voices (README "Recommended voices"): a female voice per language. Only English and
+# Chinese voices exist, so the other languages speak with the English one (cross-lingual).
+VOICES = {"en": "US_Emma", "zh": "灵小柔", **{lang: "US_Emma" for lang in MULTILINGUAL}}
+
+
+def main(args):
+ sys.path.insert(0, args.ming_dir)
+ import tts_tasks
+ from ming_tts import SPEAKER_EMBEDDING_DIM, MingTTS, trim_trailing_silence
+
+ if args.split not in LANGUAGES:
+ raise ValueError(f"Ming-3.0-tts does not speak split '{args.split}'.")
+
+ set_seed(args.seed)
+ # cache_prompts=False: every row encodes its own reference inside the timed region, like the
+ # other voice-cloning backends (each Seed-TTS / CV3 row has its own prompt anyway).
+ tts = MingTTS(args.model_id, device=args.device, text_normalization=False, cache_prompts=False)
+ sampling_rate = int(tts.sample_rate) # 44100
+ print(f"Loaded Ming-3.0-tts ({args.model_id}, sr={sampling_rate})")
+ print_model_size(tts.model)
+
+ language_id = args.split if args.split in MULTILINGUAL else None
+ sampling = dict(cfg=args.cfg, sigma=args.sigma, temperature=args.temperature)
+
+ def request(text, prompt_path=None, prompt_text=None):
+ """`synthesize` kwargs for one row in the selected mode."""
+ if args.voice_clone:
+ return dict(task="TTS", text=text, language_id=language_id, prompt_wav_path=prompt_path,
+ prompt_text=prompt_text, use_spk_emb=True, **sampling)
+ return dict(task="IP", text=text, language_id=language_id,
+ controls={"ip": args.voice or VOICES[args.split]}, use_zero_spk_emb=True, **sampling)
+
+ def synth_one(text, prompt_path=None, prompt_text=None):
+ """Synthesize one text. Return (audio_1d_numpy, elapsed_s)."""
+ torch.cuda.synchronize(args.device)
+ start = time.perf_counter()
+ # synthesize() returns a CPU tensor, so the clock stops once the audio is materialised.
+ audio = tts.synthesize(raw_text=True, max_decode_steps=args.max_decode_steps,
+ **request(text, prompt_path, prompt_text))
+ elapsed = time.perf_counter() - start
+ return audio.reshape(-1).numpy().astype(np.float32), elapsed
+
+ def synth_one_streaming(text, early_stop=False):
+ """TTFA probe only (built-in voice): return (audio_1d_numpy, first_audio_ts).
+
+ Mirrors synthesize() for the IP task, but drives the model's step generator directly and
+ feeds each sampled latent patch to the VAE decoder's streaming path (`use_cache` +
+ `stream_state`); the first time that returns samples is the first playable audio. The
+ whole utterance is then decoded in one pass, as synthesize() does (chunked decoding gives
+ slightly different audio at the chunk boundaries).
+ """
+ req = tts_tasks.build_task_generation_kwargs(**request(text))
+ model = tts.model
+ latents, first, chunk = [], None, None
+ cache, state = None, (None, None, None)
+ with torch.inference_mode(), torch.autocast(device_type="cuda", dtype=torch.bfloat16):
+ for latent, _ in model.sample(
+ prompt=req["prompt"], text=req["text"], spk_emb=[torch.zeros(1, SPEAKER_EMBEDDING_DIM)],
+ instruction=req["instruction"], max_decode_steps=args.max_decode_steps,
+ cfg=req["cfg"], sigma=req["sigma"], temperature=req["temperature"],
+ use_zero_spk_emb=True,
+ ):
+ latents.append(latent)
+ if first is None:
+ chunk, state, cache = model.audio.decode(
+ latent, past_key_values=cache, use_cache=True, stream_state=state, last_chunk=False)
+ if chunk.numel():
+ chunk = chunk.float().cpu().numpy().reshape(-1) # .cpu() syncs
+ first = time.perf_counter()
+ if early_stop:
+ return chunk, first
+ speech = model.audio.decode(torch.cat(latents, dim=1), past_key_values=None,
+ use_cache=False, last_chunk=True)[0]
+ audio = trim_trailing_silence(speech.cpu().float()[0], sampling_rate).reshape(-1).numpy()
+ return audio, first or time.perf_counter()
+
+ # Layout: results/<model_safe>/{manifest.jsonl, <dsid>/output_<id>.wav}; manifest paths are
+ # relative to model_dir. The two modes' audio is kept apart so they don't overwrite each other.
+ mode_suffix = "_voice_clone" if args.voice_clone else ""
+ paths = output_paths(args, mode_suffix)
+ model_dir, dataset_dir_name, manifest_path = paths.model_dir, paths.dataset_dir_name, paths.manifest_path
+ if args.voice_clone:
+ os.makedirs(os.path.join(paths.output_dir, "prompts"), exist_ok=True)
+
+ dataset = load_tts_dataset(args, ("prompt_text", "prompt_audio") if args.voice_clone else ())
+
+ def write_prompt(sample_id, prompt_audio):
+ """Write a cloning reference to a wav (MingTTS reads it from a path; stage 3 scores against it),
+ with its trailing silence trimmed (see the module docstring).
+
+ Returns (path relative to model_dir, full path). Done outside the timed region.
+ """
+ rel = os.path.join(dataset_dir_name, "prompts", f"prompt_{sample_id}.wav")
+ full = os.path.join(model_dir, rel)
+ if not os.path.exists(full):
+ audio = torch.from_numpy(np.asarray(prompt_audio["array"], dtype=np.float32)).reshape(1, -1)
+ audio = trim_trailing_silence(audio, prompt_audio["sampling_rate"])
+ sf.write(full, audio[0].numpy(), prompt_audio["sampling_rate"])
+ return rel, full
+
+ # ── TTFA probe: latency only, writing nothing but a JSON sidecar ─────────
+ # Built-in voice only (the leaderboard's TTFA runs without voice cloning).
+ # 0 = off; N > 0 = N evenly spaced samples; N < 0 = the whole split (see scripts/ttfa_probe.py).
+ if args.ttfa_probe != 0:
+ if args.voice_clone:
+ raise ValueError("The TTFA probe runs with a built-in voice; drop --voice_clone.")
+ # Imported here: ttfa_probe.py is injected only by submit_ttfa_jobs.sh.
+ from ttfa_probe import run_probe, sample_indices
+
+ def _ttfa_gen(job, early_stop):
+ audio, first = synth_one_streaming(job["text"], early_stop)
+ return audio, sampling_rate, first
+
+ # The probe discards its first rows as warm-up but does not run one: compile the kernels
+ # here so the first probed rows are not dominated by CUDA initialisation.
+ for i in range(min(args.warmup_steps, len(dataset))):
+ synth_one(dataset[i][args.text_column])
+ set_seed(args.seed)
+
+ run_probe(
+ _ttfa_gen,
+ [{"text": dataset[i][args.text_column]} for i in sample_indices(args.ttfa_probe, len(dataset))],
+ model_id=args.model_id, dataset_path=args.dataset_path,
+ dataset_config=args.dataset, split=args.split,
+ out_dir=model_dir, n=args.ttfa_probe,
+ extra={"device": args.device, "voice": args.voice or VOICES[args.split]},
+ )
+ return
+
+ done_entries = load_done_entries(manifest_path, args.resume)
+ manifest_file = open_manifest(manifest_path, done_entries)
+
+ def run_row(row):
+ """Synthesize one dataset row. Return (audio, elapsed, prompt path relative to model_dir)."""
+ if not args.voice_clone:
+ return (*synth_one(row[args.text_column]), None)
+ prompt_rel, prompt_full = write_prompt(row["id"], row["prompt_audio"])
+ return (*synth_one(row[args.text_column], prompt_full, row["prompt_text"]), prompt_rel)
+
+ # Serial synthesis: one sample per "batch"; warm-up runs untimed on the first pending samples.
+ starts = pending_batches(dataset, 1, done_entries, dataset_dir_name)
+ warm_up(lambda batch: run_row({k: v[0] for k, v in batch.items()}), dataset, starts, 1, args.warmup_steps)
+ set_seed(args.seed) # so warm-up does not shift the RNG stream of the timed run
+
+ # ── Main loop: synthesize one sample at a time → write JSONL ─────────────
+ for i in tqdm(starts, desc="Generating"):
+ row = dataset[i]
+ audio, elapsed, prompt_rel = run_row(row)
+
+ # Store the path relative to model_dir (the manifest's dir); write to the full path.
+ rel_path = wav_rel_path(dataset_dir_name, row["id"])
+ sf.write(os.path.join(model_dir, rel_path), audio, sampling_rate)
+
+ entry = manifest_entry(rel_path, len(audio) / sampling_rate, elapsed, row[args.text_column], prompt_rel)
+ write_entry(manifest_file, entry)
+ manifest_file.flush()
+
+ manifest_file.close()
+ print("Results saved at path:", os.path.abspath(manifest_path))
+ print_next_steps(args.voice_clone)
+
+
+if __name__ == "__main__":
+ parser = argparse.ArgumentParser()
+
+ parser.add_argument("--model_id", type=str, default="inclusionAI/Ming-3.0-tts-0.5B", help="Ming-3.0-tts repo id.")
+ parser.add_argument("--ming_dir", type=str, default=os.environ.get("MING_DIR", "/opt/Ming-3.0-tts"),
+ help="Checkout of https://github.com/inclusionAI/Ming-3.0-tts (provides ming_tts).")
+ parser.add_argument("--voice", type=str, default=None,
+ help="Built-in voice (`ip`) without --voice_clone; default: VOICES[split].")
+ # Sampling defaults from the repo's infer.py / MingTTS.synthesize.
+ parser.add_argument("--cfg", type=float, default=2.0, help="Classifier-free guidance scale.")
+ parser.add_argument("--sigma", type=float, default=0.25, help="Flow-matching sampling sigma.")
+ parser.add_argument("--temperature", type=float, default=0.0, help="Flow-matching sampling temperature.")
+ parser.add_argument("--max_decode_steps", type=int, default=1000, help="Max autoregressive steps per sample.")
+ add_common_args(parser, voice_clone=False)
+
+ args = parser.parse_args()
+
+ print("*" * 100)
+ print(f"Generating TTS with {args.model_id} on {args.dataset_path} / {args.dataset} / {args.split}")
+ print("*" * 100)
+
+ main(args)
diff --git a/ming-tts/submit_jobs.sh b/ming-tts/submit_jobs.sh
new file mode 100644
index 0000000..f3a5655
--- /dev/null
+++ b/ming-tts/submit_jobs.sh
@@ -0,0 +1,66 @@
+#!/bin/bash
+# HF Jobs TTS eval — Ming-3.0-tts backend (generate → transcribe → SIM* → score; *voice-clone only).
+# Runs locally; submits HF Jobs. Usage: HF_TOKEN=hf_... bash submit_jobs.sh ["inclusionAI/Ming-3.0-tts-0.5B" ...]
+# Shared orchestration (stages 2/3, injection, logging, scoring) lives in scripts/tts_jobs_common.sh.
+source "$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)/scripts/tts_jobs_common.sh"
+
+# ── Backend config ───────────────────────────────────────────────────────────
+TTS_SPACE="${TTS_SPACE:-bezzam/evals-ming-tts}" # stage-1 image (Dockerfile in the Space: https://huggingface.co/spaces/bezzam/evals-ming-tts/blob/main/Dockerfile)
+# gen FLAVOR (h200) is set centrally in tts_jobs_common.sh for RTFx comparability — don't override.
+RUN_EVAL_INJECT="$(inject_run_eval)"
+
+# VOICE_CLONE=true: zero-shot voice cloning + SIM; false (default) = a built-in voice. Both modes cover
+# the model's seven languages (built-in voices exist for English and Chinese; the other five use the
+# English voice cross-lingually, see run_eval.py).
+SUPPORTS_VOICE_CLONE=true
+supports_language() { [[ " en zh ja ko de fr es " == *" $1 "* ]]; }
+
+# ── Stage 1: TTS generation. MODEL_CFG = "model_id" (batch 1: the model's code assumes it). ──
+generate_stage() {
+ hf jobs run \
+ --flavor "${FLAVOR}" --timeout 8h --secrets HF_TOKEN ${NAMESPACE_ARG} \
+ --volume "hf://buckets/${RESULTS_BUCKET}:/results" "${TTS_IMAGE}" \
+ bash -c "
+ ${RUN_EVAL_INJECT}
+ cd /app/ming-tts && python run_eval.py \
+ --model_id=${MODEL_ID} \
+ --dataset_path=${DATASET_PATH} \
+ --dataset=${DATASET} \
+ --split=${SPLIT} \
+ --device=cuda:0 \
+ --max_eval_samples=${MAX_EVAL_SAMPLES} \
+ ${VOICE_CLONE_FLAG} &&
+ mkdir -p /results &&
+ cp -r results/${MODEL_SAFE} /results/
+ "
+}
+
+# ── Datasets: "config split asr_language [dataset_path]" (comment/uncomment) ──
+# supports_language() skips the splits the selected mode can't do.
+# Without a 4th field the line uses DEFAULT_DATASET_PATH (hf-audio/seed_tts_eval).
+DATASET_CONFIGS=(
+ "tts en en"
+ "tts zh zh"
+ "zero_shot en en ${CV3_EVAL_PATH}"
+ "zero_shot zh zh ${CV3_EVAL_PATH}"
+ "zero_shot fr fr ${CV3_EVAL_PATH}"
+ "zero_shot es es ${CV3_EVAL_PATH}"
+ "zero_shot ja ja ${CV3_EVAL_PATH}"
+ "zero_shot ko ko ${CV3_EVAL_PATH}"
+ "zero_shot de de ${CV3_EVAL_PATH}"
+ "tts en en ${MINIMAX_EVAL_PATH}"
+ "tts zh zh ${MINIMAX_EVAL_PATH}"
+ "tts ja ja ${MINIMAX_EVAL_PATH}"
+ "tts ko ko ${MINIMAX_EVAL_PATH}"
+ "tts fr fr ${MINIMAX_EVAL_PATH}"
+ "tts de de ${MINIMAX_EVAL_PATH}"
+ "tts es es ${MINIMAX_EVAL_PATH}"
+)
+
+# ── Models: "model_id" (CLI args override) ───────────────────────────────────
+MODEL_CONFIGS=(
+ "inclusionAI/Ming-3.0-tts-0.5B"
+)
+[[ $# -gt 0 ]] && MODEL_CONFIGS=("$@")
+
+run_pipeline
diff --git a/submit_ttfa_jobs.sh b/submit_ttfa_jobs.sh
index 88664f1..2dc26f2 100755
--- a/submit_ttfa_jobs.sh
+++ b/submit_ttfa_jobs.sh
@@ -138,7 +138,14 @@ TTFA_TARGETS=(
"kokoro|kokoro|bezzam/evals-kokoro|hexgrad/Kokoro-82M|"
# GPU only: liquid-audio hard-codes its detokenizer to CUDA (audiocpp-lfm2-audio below covers CPU).
"lfm2-audio|lfm2-audio|bezzam/evals-lfm2-audio|LiquidAI/LFM2.5-Audio-1.5B|--voice=us_female"
+ # Streams: the codec decodes the first speech frame as soon as it is sampled (lfm3-audio/run_eval.py).
+ "lfm3-audio|lfm3-audio|bezzam/evals-lfm3-audio|LiquidAI/LFM3-Audio-2B|--voice=female"
"magpie-tts|magpie-tts|bezzam/evals-magpie|nvidia/magpie_tts_multilingual_357m|--speaker=Sofia --language=${TTFA_LANG}"
+ # GPU only (the engine's fused kernels are Triton). Streams: the engine emits PCM per 80 ms frame.
+ "maya2|maya2|bezzam/evals-maya2|maya-research/maya2-native|--voice=Ahana"
+ # GPU only (the model's code hard-codes CUDA autocast). Streams: the VAE decoder's streaming path
+ # decodes the first latent patch as soon as it is sampled (ming-tts/run_eval.py).
+ "ming-tts|ming-tts|bezzam/evals-ming-tts|inclusionAI/Ming-3.0-tts-0.5B|"
"moss-tts|moss-tts|bezzam/evals-moss|OpenMOSS-Team/MOSS-TTS|"
"neutts-nano|neutts-nano|bezzam/evals-neutts|neuphonic/neutts-nano|"
# Same image, quantized backbone. NeuTTS only streams on the gguf path; the torch target above
@@ -214,7 +221,7 @@ if ${PHONON_SELECTED}; then
fi
# Backends whose run_eval.py has no --voice_clone flag at all; passing one would be an error.
-NO_CLONE_FLAG="inflect-nano inflect-v2 kokoro lfm2-audio magpie-tts paradee phonon photon qwen3tts qwen3tts-fast supertonic vibevoice_realtime voxtral-tts"
+NO_CLONE_FLAG="inflect-nano inflect-v2 kokoro lfm2-audio lfm3-audio magpie-tts paradee phonon photon qwen3tts qwen3tts-fast supertonic vibevoice_realtime voxtral-tts"
# run_eval.py writes to its own output roots (outside Git, mode 0700) and names the sidecar itself,
# so Phonon skips the generic run/rename/copy below; `preamble` is submit_one's CPU thread cap.
diff --git a/transformers/submit_jobs.sh b/transformers/submit_jobs.sh
index 5a681c9..d7f87f7 100755
--- a/transformers/submit_jobs.sh
+++ b/transformers/submit_jobs.sh
@@ -81,7 +81,6 @@ DATASET_CONFIGS=(
"zero_shot es es ${CV3_EVAL_PATH}"
"zero_shot it it ${CV3_EVAL_PATH}"
"zero_shot ru ru ${CV3_EVAL_PATH}"
- # MiniMax multilingual (100 sentences/language). No `uk`: Qwen3-ASR has no Ukrainian.
"tts en en ${MINIMAX_EVAL_PATH}"
"tts zh zh ${MINIMAX_EVAL_PATH}"
"tts yue yue ${MINIMAX_EVAL_PATH}"