-
Notifications
You must be signed in to change notification settings - Fork 632
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Should throw an error if repo_id
is not valid
#1008
Comments
Hmm thinking twice about it, do we want to validate repo_ids in the form It is not a valid |
no strong opinion on whether we want to support this form |
Just realized I didn't give my opinion. I would definitely avoid We just need to be aware that will break some code elsewhere and we can hardly identify where beforehand. |
yes, IMO breakage in the wild should be rather limited |
I'd also definitely avoid Sounds good for validation! |
(re last comment: it would have broken transformers, shame on me) |
validate_repo_id |
Related to huggingface/transformers#18691.
Currently if
repo_id
value is set to a wrong value, there is no validation before calling cache/the hub. Typically, if the value is a path"./resources/ltp"
(by mistake from the user) inhf_hub_download
, then it will raise aFileNotFoundError
:It would be good to have a helper to validate a
repo_id
and raise a custom exception if it's obvious than it is not a validrepo_id
. As a first step I would consider any value in the form "xxx/xxx" or "xxx".The text was updated successfully, but these errors were encountered: