transformers
705a7cf8 - [tests] Fix flaky CMVN tests in Speech2TextFeatureExtractionWithoutTorchaudioTest (#49374)

Commit
31 days ago
[tests] Fix flaky CMVN tests in Speech2TextFeatureExtractionWithoutTorchaudioTest (#49374) * [tests] Fix flaky CMVN tests in Speech2TextFeatureExtractionWithoutTorchaudioTest The WithoutTorchaudio mel implementation has slightly different fp32 precision vs torchaudio. For rare random inputs generated by unseeded `global_rng`, CMVN normalization leaves a residual mean just above the 1e-3 threshold, causing ~0.05-0.15% flaky failures. Fix: seed `global_rng` before each of the 4 CMVN test methods in the subclass, making test inputs deterministic without changing the tests themselves. Confirmed via 5000-run flakefinder (0 failures with seed vs 1 failure in 1962 without). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * style: ruff format speech_to_text test --------- Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
Author
Parents
Loading