Skip to content

[Modeling] Add token support for hf_hub_download#604

Merged
younesbelkada merged 2 commits intomainfrom
add-token-arg
Aug 3, 2023
Merged

[Modeling] Add token support for hf_hub_download#604
younesbelkada merged 2 commits intomainfrom
add-token-arg

Conversation

@younesbelkada
Copy link
Copy Markdown
Contributor

Fixes #602

As per title, let's add the token argument in the from_pretrained method to allow users to pass their HF tokens to download from private repos.

cc @lvwerra

@HuggingFaceDocBuilderDev
Copy link
Copy Markdown

HuggingFaceDocBuilderDev commented Aug 2, 2023

The documentation is not available anymore as the PR was closed or merged.

@lvwerra
Copy link
Copy Markdown
Member

lvwerra commented Aug 2, 2023

Isn't it usually use_auth_token in the from_pretrained method? Happy to add it in general :)

@younesbelkada
Copy link
Copy Markdown
Contributor Author

younesbelkada commented Aug 3, 2023

Use auth token is deprecated : https://github.com/huggingface/transformers/blob/main/src/transformers/modeling_utils.py#L1714-L1724 but happy to add it if you think it is relevant (maybe for consistency with transformers) wdyt?

Copy link
Copy Markdown
Member

@lvwerra lvwerra left a comment

Choose a reason for hiding this comment

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

didn't know that! no then it's fine.

@younesbelkada younesbelkada merged commit e448bb6 into main Aug 3, 2023
@younesbelkada younesbelkada deleted the add-token-arg branch August 3, 2023 10:49
yxliu-TAMU pushed a commit to mincheolseong/ECEN743-GRPO-Project-Proposal that referenced this pull request Apr 20, 2025
* add token support for hf_hub_download

* allow to pass it to from_pretrained
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.

token is not supported for private repos

3 participants