feat(tts): MOSS-TTS-Nano backend (beta) — streaming zero-shot voice cloning, 48 kHz stereo - #917
Alex-Wengg wants to merge 3 commits into
Conversation
…xtension ModelHub.repoIncludeRule builds one pattern per required model with a trailing "/" (bundle directories). For repos without a subPath, a required plain file was only admitted by prefix match or by the .json/.txt allowance, so a required root file such as `tokenizer.model` never matched "tokenizer.model/" and the post-download verify pass threw modelNotFound. Accept a pattern that equals the file path plus "/". Regression test added. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018UHoFANi4DcvU6TzyTPnHH
… 48 kHz stereo Swift host for the CoreML conversion of OpenMOSS-Team/MOSS-TTS-Nano-100M (FluidInference/moss-tts-nano-coreml): Prefill -> (Frame -> CodecStep -> Step) per 80 ms frame, sampling inside the Frame graph from host uniforms. - MossTtsNanoTokenizer: SentencePiece BPE with nmt_nfkc normalization, dummy prefix and byte fallback; id-exact against the upstream processor on 8 vectors (English, Chinese, Japanese, Russian, emoji, whitespace edge cases). The PocketTTS SentencePieceTokenizer is unigram and cannot serve this model. - MossTtsNanoTextChunker: upstream sentence/clause/token-budget splitter and inter-chunk pauses. MossTtsNanoPromptBuilder: voice-clone row layout from the repo's config.json (template ids, special tokens). - MossTtsNanoManager: preset voices (en_2, zh_1), cloneVoice(audioURL:) via the fp32 codec encoder, synthesize / synthesizeStreaming (AsyncThrowingStream of stereo frames), seedable sampling. - Prefill/Step pinned to CPU+GPU (ANECCompile fails); Frame/CodecStep honour the requested compute units. - CLI: --backend moss-tts-nano with --voice/--clone-voice/--save-voice/ --voice-file/--seed/--greedy/--tokens-only; stereo WAV writer. - SentencePieceProto: parse the piece `type` field. - Docs: Documentation/TTS/MossTtsNano.md, Documentation/Models.md rows. Depends on the ModelHub root-file include fix (#918): tokenizer.model is a required root-level file. Measured (M5 Pro, release CLI, en_2 voice, 9-10 s utterances): RTFx 3.1-3.8x, first audio 0.22-0.40 s; zh_1 3 s utterance 2.5x. Parakeet WER 0 % on the 27-word phrase, one spurious trailing word on the short one. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018UHoFANi4DcvU6TzyTPnHH
1256325 to
1e29207
Compare
PocketTTS Smoke Test ✅
Runtime: 0m7s Note: PocketTTS uses CoreML MLState (macOS 15) KV cache + Mimi streaming state. CI VM lacks physical GPU — audio quality and performance may differ from Apple Silicon. |
Supertonic3 Smoke Test ✅
Runtime: 0m23s Note: CI VMs lack a physical Neural Engine; the ANE-bucketed VectorEstimator falls back to CPU here. This validates download + variant resolution + synthesis, not ANE residency/perf. |
Parakeet EOU Benchmark Results ✅Status: Benchmark passed Performance Metrics
Streaming Metrics
Test runtime: 1m22s • 09/13/2026, 08:19 PM EST RTFx = Real-Time Factor (higher is better) • Processing includes: Model inference, audio preprocessing, state management, and file I/O |
Sortformer High-Latency Benchmark ResultsES2004a Performance (30.4s latency config)
Sortformer High-Latency • ES2004a • Runtime: 2m 54s • 2026-09-14T00:01:51.985Z |
Offline VBx Pipeline ResultsSpeaker Diarization Performance (VBx Batch Mode)Optimal clustering with Hungarian algorithm for maximum accuracy
Offline VBx Pipeline Timing BreakdownTime spent in each stage of batch diarization
Speaker Diarization Research ComparisonOffline VBx achieves competitive accuracy with batch processing
Pipeline Details:
🎯 Offline VBx Test • AMI Corpus ES2004a • 1049.0s meeting audio • 102.2s processing • Test runtime: 1m 53s • 09/13/2026, 08:23 PM EST |
VAD Benchmark ResultsPerformance Comparison
Dataset Details
✅: Average F1-Score above 70% |
ASR Benchmark Results ✅Status: All benchmarks passed Parakeet v3 (multilingual)
Parakeet v2 (English-optimized)
Streaming (v3)
Streaming (v2)
Streaming tests use 5 files with 0.5s chunks to simulate real-time audio streaming 25 files per dataset • Test runtime: 9m14s • 09/13/2026, 08:45 PM EST RTFx = Real-Time Factor (higher is better) • Calculated as: Total audio duration ÷ Total processing time Expected RTFx Performance on Physical M1 Hardware:• M1 Mac: ~28x (clean), ~25x (other) Testing methodology follows HuggingFace Open ASR Leaderboard |
Speaker Diarization Benchmark ResultsSpeaker Diarization PerformanceEvaluating "who spoke when" detection accuracy
Diarization Pipeline Timing BreakdownTime spent in each stage of speaker diarization
Speaker Diarization Research ComparisonResearch baselines typically achieve 18-30% DER on standard datasets
Note: RTFx shown above is from GitHub Actions runner. On Apple Silicon with ANE:
🎯 Speaker Diarization Test • AMI Corpus ES2004a • 1049.0s meeting audio • 64.5s diarization time • Test runtime: 3m 51s • 09/13/2026, 08:39 PM EST |
…xtension (#918) ## Summary `ModelHub.repoIncludeRule` builds one pattern per required model with a trailing `/` (bundle directories). For repos without a `subPath`, a required plain *file* was admitted only by prefix match or by the `.json` / `.txt` allowance, so a required root-level file such as `tokenizer.model` never matched `tokenizer.model/` and the post-download verify pass threw `modelNotFound` (every run re-listed the repo and failed again). The rule now also accepts a pattern that equals the file path plus `/`. No change for subPath repos or for bundle directories. ## Test - `ModelHubIncludeRuleTests.testRequiredRootFileWithoutMetadataExtensionIncluded` covers the required file, an unrelated `.model` file, and bundle paths. - Surfaced while wiring the MOSS-TTS-Nano backend (#917), which depends on this fix. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_018UHoFANi4DcvU6TzyTPnHH
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018UHoFANi4DcvU6TzyTPnHH
Summary
Swift backend for MOSS-TTS-Nano (OpenMOSS, Apache-2.0): 0.1B multilingual streaming TTS with zero-shot voice cloning, 20 languages, native 48 kHz stereo output. Weights: FluidInference/moss-tts-nano-coreml; conversion: FluidInference/mobius#92.
Pipeline per 80 ms frame:
Prefill → (Frame → CodecStep → Step)*. Sampling (top-k/top-p/temperature/repetition penalty) is inside the Frame graph; the host supplies uniform randoms, soseedgives reproducible runs.MossTtsNanoManager(actor):loadVoice(.en2/.zh1),cloneVoice(audioURL:)(fp32 codec encoder, fetched on demand),synthesize,synthesizeStreaming(AsyncThrowingStreamof stereo frames),tokenize.MossTtsNanoTokenizer: SentencePiece BPE (nmt_nfkc, dummy prefix, byte fallback) — id-exact vs upstreamsentencepieceon 8 vectors (en/zh/ja/ru/emoji/whitespace). The PocketTTS unigram tokenizer cannot serve this model;SentencePieceProtonow also parses the piecetype.MossTtsNanoTextChunker/MossTtsNanoPromptBuilder: upstream sentence→clause→token-budget chunking with inter-chunk pauses; prompt rows built from the repo'sconfig.json(template ids + special tokens, nothing hardcoded).--backend moss-tts-nanowith--voice,--clone-voice,--save-voice,--voice-file,--seed,--greedy,--tokens-only; stereo WAV writer.Documentation/TTS/MossTtsNano.md,Documentation/Models.mdrows.Depends on #918 (ModelHub root-level required-file download fix —
tokenizer.model). The branch is stacked on that fix; the diff shrinks to the backend once #918 merges.Validation (M5 Pro, macOS 26.7)
--tokens-only.en_2voice, 9–10 s utterances: RTFx 3.1–3.8×, first audio 0.22–0.40 s; Mandarinzh_13 s utterance 2.5×.tts-asr-verify --score-only) on two English phrases: 0 % WER on the 27-word phrase, one spurious trailing word on the short one (sampled output; PyTorch upstream scores 10.1 % on the same pair).ANECCompilefails on those graphs); Frame/CodecStep honour the requested compute units.swift testis unavailable locally (no XCTest); relying on CI.Not in this PR
MLState) Step variant to avoid the 38 MB KV round trip per frame.tts-benchmarkwiring for the new backend.🤖 Generated with Claude Code
https://claude.ai/code/session_018UHoFANi4DcvU6TzyTPnHH