Skip to content

fix: stop ASR generation_kwargs leaking across compute calls - #799

Open
tonycoder-hub wants to merge 1 commit into
huggingface:mainfrom
tonycoder-hub:cursor/fix-asr-generation-kwargs-leak-6f52
Open

fix: stop ASR generation_kwargs leaking across compute calls#799
tonycoder-hub wants to merge 1 commit into
huggingface:mainfrom
tonycoder-hub:cursor/fix-asr-generation-kwargs-leak-6f52

Conversation

@tonycoder-hub

Copy link
Copy Markdown

AutomaticSpeechRecognitionEvaluator.compute called self.PIPELINE_KWARGS.update(generation_kwargs). PIPELINE_KWARGS is a class attribute, so kwargs from one compute leaked into later calls and other instances. Same leak #796 fixed for text2text.

Now rebinds an instance-level copy per call.

Tests: python -m pytest tests/test_evaluator.py -q — 43 passed, 14 skipped. Distinct from #790-#798.

AutomaticSpeechRecognitionEvaluator.compute updated the class-level
PIPELINE_KWARGS dict in place, so generation_kwargs from one call were
still passed to the pipeline on every later call and on every other
evaluator instance. Build a per-call copy instead.

Co-authored-by: Tony Coder <407243179@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants