{{ message }}
Fix incorrect documented defaults for HF wrapper freeze/output_norm (#3060)#3062
Merged
TParcollet merged 1 commit intoJun 15, 2026
Conversation
Fixes speechbrain#3060. Several HuggingFace integration wrappers documented `freeze` (and `output_norm`) as defaulting to True, while their __init__ signatures actually default to False. The correctly-written W2VBert wrapper already documents these as False, confirming the others are copy-paste errors. Corrects the docstrings (no behavior change) in: - Wav2Vec2 (the reported case): output_norm and freeze - WavLM, Hubert, MERT: output_norm and freeze - WeightedSSLModel and the base HFTransformersInterface: freeze
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.

Summary
Fixes #3060.
Several HuggingFace integration wrappers document
freeze(and, for the SSL feature-extractor wrappers,output_norm) as defaulting toTrue, but their__init__signatures actually default toFalse. The reported case isWav2Vec2.freeze(docstring saysdefault: True, code isfreeze=False).This is a copy-paste error: the more recently added
W2VBertwrapper documents these arguments correctly (output_norm→False,freeze→Truematching its own signature), which confirms the intended fix is to correct the docstrings rather than change any runtime defaults.This PR is documentation only — no behavior changes.
Changes
Corrected the documented defaults to match the actual
__init__defaults:True→False)huggingface/wav2vec2.py(reported)output_norm,freezehuggingface/wavlm.pyoutput_norm,freezehuggingface/hubert.pyoutput_norm,freezehuggingface/mert.pyoutput_norm,freezehuggingface/weighted_ssl.pyfreezehuggingface/huggingface.py(baseHFTransformersInterface)freezeWrappers that were already consistent (
w2v_bert,whisper,gpt,nllb,mbart,textencoder,labse,llama) were left untouched.Verification
__init__signature.ruff checkandruff format --checkpass on all changed files.tests/utils/check_docstrings.pypresence check are unaffected.