Conversation
…_eval.py The DNS copy of eval_composite takes (ref_wav, deg_wav, sample_rate), but the __main__ block still uses the two-argument form carried over from the Voicebank recipe, so running composite_eval.py raises TypeError immediately. train.py in the same recipe already passes self.hparams.sample_rate. The sample rate is taken from librosa.load(..., sr=None), which already reads the file's native rate and previously discarded it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Running
recipes/DNS/enhancement/composite_eval.pyas a script failsimmediately with
TypeError: eval_composite() missing 1 required positional argument: 'sample_rate'.The DNS copy of
eval_compositetakes three arguments (composite_eval.py:19):sample_rateis genuinely required — it is forwarded towss(),llr()andSSNR()inside the function body. But the__main__block atcomposite_eval.py:459still calls it with two:Why the intended fix is unambiguous
The same recipe already contains a correct call —
recipes/DNS/enhancement/train.py:462:And
recipes/Voicebank/MTL/ASR_enhance/composite_eval.pystill carries thepre-change shape this file was copied from — a two-parameter
def eval_composite(ref_wav, deg_wav)with a matching two-argument call at:435. So the DNS copy gained thesample_rateparameter,train.pywasupdated, and this script's
__main__block was not.recipes/DNS/enhancement/train.py:462recipes/DNS/enhancement/composite_eval.py:459recipes/Voicebank/MTL/ASR_enhance/composite_eval.py:435The change
librosa.load(..., sr=None)already loads at the file's native sample rate andreturns it as the second element — the script was discarding it with
[0].This PR keeps that value and passes it through, so the metrics are computed at
the rate the audio is actually stored at rather than at a hardcoded guess:
Checked with the pinned
ruffv0.12.4 from.pre-commit-config.yaml, run fromthe repository root:
ruff format --checkreports 1 file already formattedand
ruff checkreports All checks passed!🤖 Generated with Claude Code