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

ConnectionError for gated datasets and unauthenticated users #7109

Closed
albertvillanova opened this issue Aug 19, 2024 · 0 comments · Fixed by #7110
Closed

ConnectionError for gated datasets and unauthenticated users #7109

albertvillanova opened this issue Aug 19, 2024 · 0 comments · Fixed by #7110
Assignees

Comments

@albertvillanova
Copy link
Member

albertvillanova commented Aug 19, 2024

Since the Hub returns dataset info for gated datasets and unauthenticated users, there is dead code:

datasets/src/datasets/load.py

Lines 1846 to 1852 in 98fdc9e

except GatedRepoError as e:
message = f"Dataset '{path}' is a gated dataset on the Hub."
if "401 Client Error" in str(e):
message += " You must be authenticated to access it."
elif "403 Client Error" in str(e):
message += f" Visit the dataset page at https://huggingface.co/datasets/{path} to ask for access."
raise DatasetNotFoundError(message) from e

We should remove the dead code and properly handle this case: currently we are raising a ConnectionError instead of a DatasetNotFoundError (as before).

See:

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