Fix incorrect documented defaults for HF wrapper freeze/output_norm (#3060) by deekshaNVIDIA · Pull Request #3062 · speechbrain/speechbrain · GitHub
Skip to content

Fix incorrect documented defaults for HF wrapper freeze/output_norm (#3060)#3062

Merged
TParcollet merged 1 commit into
speechbrain:developfrom
deekshaNVIDIA:fix-hf-wrapper-default-docstrings
Jun 15, 2026
Merged

Fix incorrect documented defaults for HF wrapper freeze/output_norm (#3060)#3062
TParcollet merged 1 commit into
speechbrain:developfrom
deekshaNVIDIA:fix-hf-wrapper-default-docstrings

Conversation

@deekshaNVIDIA

Copy link
Copy Markdown
Contributor

Summary

Fixes #3060.

Several HuggingFace integration wrappers document freeze (and, for the SSL feature-extractor wrappers, output_norm) as defaulting to True, but their __init__ signatures actually default to False. The reported case is Wav2Vec2.freeze (docstring says default: True, code is freeze=False).

This is a copy-paste error: the more recently added W2VBert wrapper documents these arguments correctly (output_normFalse, freezeTrue matching 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:

File Argument(s) corrected (TrueFalse)
huggingface/wav2vec2.py (reported) output_norm, freeze
huggingface/wavlm.py output_norm, freeze
huggingface/hubert.py output_norm, freeze
huggingface/mert.py output_norm, freeze
huggingface/weighted_ssl.py freeze
huggingface/huggingface.py (base HFTransformersInterface) freeze

Wrappers that were already consistent (w2v_bert, whisper, gpt, nllb, mbart, textencoder, labse, llama) were left untouched.

Verification

  • Confirmed each corrected default against the corresponding __init__ signature.
  • ruff check and ruff format --check pass on all changed files.
  • The change is docstring-only, so existing behavior and the tests/utils/check_docstrings.py presence check are unaffected.

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
@TParcollet TParcollet merged commit d0d15bb into speechbrain:develop Jun 15, 2026
5 checks passed
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.

Docstring for Wav2Vec2.freeze indicates default is True, but code sets default to False

2 participants