Skip to content

Rename FetchConfig.use_auth_token to token and pass token to HF hub#2996

Merged
pplantinga merged 2 commits intospeechbrain:developfrom
seohyunjun:fix-hf-token
Nov 24, 2025
Merged

Rename FetchConfig.use_auth_token to token and pass token to HF hub#2996
pplantinga merged 2 commits intospeechbrain:developfrom
seohyunjun:fix-hf-token

Conversation

@seohyunjun
Copy link
Copy Markdown
Contributor

@seohyunjun seohyunjun commented Nov 13, 2025

  • Replace use_auth_token attribute with token in FetchConfig and update docstring.
  • Update hf_hub download kwargs to use the new "token" parameter.

What does this PR do?

#2991 (comment)
Huggingface seems to replace use_auth_token with token in their methods. This change affect the run of speechbrain inference task with models on Hugglingface.

#2991 (comment)

some parameter name is change in huggingface_hub

[huggingface_hub]
https://github.com/huggingface/huggingface_hub/blob/316db10b2f56936b26757e79ee07e9cc760eb531/docs/source/en/concepts/migration.md#L78

## Other deprecated features

Some methods and parameters have been removed in v1.0. The ones listed below have already been deprecated with a warning message in v0.x.

- `constants.hf_cache_home` has been removed. Please use `HF_HOME` instead.
- `use_auth_token` parameters have been removed from all methods. Please use `token` instead. <----
- `get_token_permission` method has been removed.

[speechbrain]

def download_file(source, source_path, destination):

  hf_kwargs = {
      "repo_id": source,
      "filename": filename,
      "use_auth_token": fetch_config.use_auth_token,
      "revision": fetch_config.revision,
      "local_files_only": not fetch_config.allow_network,
  }
.
.
.
fetched_file = huggingface_hub.hf_hub_download(**hf_kwargs)

idk it works
https://github.dev/huggingface/huggingface_hub/blob/5af5644f7234135d1e1ee4780ffb9be99a3c2102/tests/test_hub_mixin_pytorch.py#L320

pip install -U "huggingface_hub==0.36.0"

Fixes #<issue_number>

Before submitting
  • Did you read the contributor guideline?
  • Did you make sure your PR does only one thing, instead of bundling different changes together?
  • Did you make sure to update the documentation with your changes? (if necessary)
  • Did you write any new necessary tests? (not for typos and docs)
  • Did you verify new and existing tests pass locally with your changes?
  • Did you list all the breaking changes introduced by this pull request?
  • Does your code adhere to project-specific code style and conventions?

PR review

Reviewer checklist
  • Is this pull request ready for review? (if not, please submit in draft mode)
  • Check that all items from Before submitting are resolved
  • Make sure the title is self-explanatory and the description concisely explains the PR
  • Add labels and milestones (and optionally projects) to the PR so it can be classified
  • Confirm that the changes adhere to compatibility requirements (e.g., Python version, platform)
  • Review the self-review checklist to ensure the code is ready for review

@seohyunjun seohyunjun marked this pull request as draft November 13, 2025 00:53
@seohyunjun seohyunjun marked this pull request as ready for review November 24, 2025 09:47
Copy link
Copy Markdown
Collaborator

@pplantinga pplantinga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@pplantinga pplantinga merged commit db2db45 into speechbrain:develop Nov 24, 2025
4 of 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.

2 participants