Standardize model loading API across all ASR managers#506
Conversation
Both Kokoro and PocketTTS smoke tests now calculate and validate RTFx metrics: - Calculate RTFx using ffprobe to get audio duration - Fail workflow with exit 1 when RTFx is 0 - Display RTFx in PR comment table with status indicator This ensures TTS smoke tests have the same failure detection as other benchmarks.
… PR comments - Move EXECUTION_TIME calculation before RTFx validation to ensure it's set even on failure - Add always() condition to Comment PR steps so they run even when RTFx validation fails - Ensures PR comments are posted with failure details instead of silently skipping
- Run 'brew link ffmpeg' to ensure ffprobe is in PATH - Add debugging to show ffprobe availability and output - Change 2>/dev/null to 2>&1 to capture ffprobe errors - Add detailed logging when RTFx calculation fails This fixes the issue where ffmpeg was installed but not linked, causing ffprobe to be unavailable and RTFx calculation to fail.
- Force-link ffmpeg with --force flag to ensure it's linked - Set explicit PATH environment variable in smoke test steps - Validate ffprobe output is numeric before passing to awk - Prevents awk syntax errors when ffprobe returns error messages This fixes the issue where ffprobe wasn't available in PATH even after installation, causing RTFx calculation to fail.
- Remove exit 1 when RTFx is 0 - Change RTFx status from ❌ to⚠️ when unavailable - RTFx is a performance metric, not a pass/fail criterion - Smoke tests pass as long as audio is generated (file size > 0) This aligns with the purpose of smoke tests: verify the pipeline works, not measure performance.
- Remove all RTFx calculation logic - Remove ffmpeg/ffprobe installation steps - Remove RTFx from PR comment tables - Simplify smoke tests to only verify audio file generation Smoke tests now pass if: 1. TTS pipeline completes without crashing 2. Output WAV file is generated with size > 0 RTFx is a performance metric better suited for benchmark workflows, not smoke tests.
- Add validation that exits with code 1 when output file doesn't exist - Add validation that exits with code 1 when output file is 0 bytes - Ensures smoke tests fail on audio generation failures This catches cases where the pipeline runs but produces no/empty output.
Unifies model loading methods to use consistent naming (loadModels) and prepositions (from:), reducing developer cognitive load and improving API discoverability. Deprecates configure() in favor of loadModels() and separates model loading from streaming activation in SlidingWindowAsrManager. Resolves #457
3f7a981 to
02b8945
Compare
VAD Benchmark ResultsPerformance Comparison
Dataset Details
✅: Average F1-Score above 70% |
Sortformer High-Latency Benchmark ResultsES2004a Performance (30.4s latency config)
Sortformer High-Latency • ES2004a • Runtime: 2m 53s • 2026-04-08T18:00:42.673Z |
PocketTTS Smoke Test ✅
Runtime: 0m38s 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. |
Kokoro TTS Smoke Test ✅
Runtime: 0m33s Note: Kokoro TTS uses CoreML flow matching + Vocos vocoder. CI VM lacks physical ANE — performance may differ from Apple Silicon. |
Parakeet EOU Benchmark Results ✅Status: Benchmark passed Performance Metrics
Streaming Metrics
Test runtime: 1m18s • 04/08/2026, 01:58 PM EST RTFx = Real-Time Factor (higher is better) • Processing includes: Model inference, audio preprocessing, state management, and file I/O |
Qwen3-ASR int8 Smoke Test ✅
Performance Metrics
Runtime: 4m54s Note: CI VM lacks physical GPU — CoreML MLState (macOS 15) KV cache produces degraded results on virtualized runners. On Apple Silicon: ~1.3% WER / 2.5x RTFx. |
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: 6m58s • 04/08/2026, 02:14 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 |
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 • 341.8s processing • Test runtime: 5m 44s • 04/08/2026, 02:09 PM EST |
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 • 51.1s diarization time • Test runtime: 2m 14s • 04/08/2026, 02:04 PM EST |
- Remove deprecated configure(models:) method from AsrManager - Remove legacy defaultCacheDirectory() method from AsrModels - Remove legacy decode() method from RnntDecoder - Update test to use non-legacy defaultCacheDirectory(for:) method
Summary
Standardizes the model loading API across all ASR managers to reduce developer cognitive load and improve consistency. This addresses issue #457 comment #4203327648.
Problem
Each ASR manager had different model loading APIs:
AsrManager:configure(models:)❌SlidingWindowAsrManager:startStreaming(models:, source:)❌StreamingEouAsrManager:loadModels(modelDir:)with inconsistent overloads ❌StreamingNemotronAsrManager:loadModels(modelDir:)❌This created developer confusion and increased documentation burden.
Solution
Unified API pattern across all managers:
Changes
loadModels(_:), deprecatedconfigure(models:)loadModels(from:)loadModels(from:)with download supportVerification
Ran full benchmark suite (8 models × 100 files) to verify zero regression:
✓ No WER/CER regressions (all within 0.3% of baseline)
Benefits
from:for loading from directory