Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unclear Error Message for GatedRepoError When --hf-token is Provided #1831

Closed
DawiAlotaibi opened this issue Oct 14, 2024 · 0 comments · Fixed by #1832
Closed

Unclear Error Message for GatedRepoError When --hf-token is Provided #1831

DawiAlotaibi opened this issue Oct 14, 2024 · 0 comments · Fixed by #1832

Comments

@DawiAlotaibi
Copy link
Contributor

Description

The error message for GatedRepoError asks the user to provide the --hf-token, even when the token is already passed via the command-line option. This is confusing for users who have already provided the token.

Expected Behavior:

If the --hf-token argument is passed, the error message should not request it again and should focus on other potential issues (e.g., access rights or incorrect token).

Current Behavior:

The error message currently states:

"Please ensure you have access to the repository and have provided the proper Hugging Face API token using the option --hf-token or by running huggingface-cli login. You can find your token by visiting https://huggingface.co/settings/tokens"
This should not appear if the --hf-token has already been provided.

Steps to Reproduce:

  1. Pass a valid --hf-token when running the command.
  2. Encounter the GatedRepoError.
  3. Observe the message requesting the token, despite it being passed.
    image

Suggested Fix:

The error message should only suggest providing the token if it wasn’t passed through the command-line argument.

@joecummings joecummings linked a pull request Oct 14, 2024 that will close this issue
13 tasks
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 a pull request may close this issue.

1 participant