Skip to content

Fix huggingface_hub >= 1.0 compatibility in BaseModel._from_pretrained#97

Open
wredan wants to merge 1 commit into
facebookresearch:mainfrom
wredan:fix/huggingface-hub-v1-compatibility
Open

Fix huggingface_hub >= 1.0 compatibility in BaseModel._from_pretrained#97
wredan wants to merge 1 commit into
facebookresearch:mainfrom
wredan:fix/huggingface-hub-v1-compatibility

Conversation

@wredan
Copy link
Copy Markdown

@wredan wredan commented Apr 11, 2026

Problem

huggingface_hub >= 1.0 removed proxies and resume_download from the keyword arguments passed by ModelHubMixin.from_pretrained() to the user-defined _from_pretrained() hook. This causes a TypeError at model load time with any recent installation:

TypeError: BaseModel._from_pretrained() missing 2 required keyword-only
arguments: 'proxies' and 'resume_download'

Reported in #85, #89, and #90. The workarounds suggested there (downgrading huggingface_hub to 0.36.0 or hardcoding default values) are fragile and break other dependencies.

Fix

  • Make proxies, resume_download, local_files_only, and token optional with None/False defaults in _from_pretrained(), matching the new ModelHubMixin contract.
  • Remove proxies and resume_download from the snapshot_download() call: both parameters have been removed from snapshot_download's signature in huggingface_hub >= 1.0 and passing them would raise a TypeError there as well.

Tested with

  • huggingface_hub==1.10.1 + transformers==5.5.3

Verified end-to-end: SAMAudio.from_pretrained() loads without error, model.separate() produces valid output on real audio.

@meta-cla
Copy link
Copy Markdown

meta-cla Bot commented Apr 11, 2026

Hi @wredan!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@meta-cla
Copy link
Copy Markdown

meta-cla Bot commented Apr 11, 2026

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Apr 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant