Should throw an error if `repo_id` is not valid
See original GitHub issueRelated to https://github.com/huggingface/transformers/issues/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) in hf_hub_download
, then it will raise a FileNotFoundError
:
FileNotFoundError: [Errno 2] No such file or directory: '/home/chaizhihua/.cache/huggingface/hub/models--.--resources--ltp/refs/main'
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 valid repo_id
. As a first step I would consider any value in the form “xxx/xxx” or “xxx”.
Issue Analytics
- State:
- Created a year ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
c# - Error Handling Should I throw exception? Or handle at the ...
The rule of thumb I always use is: At low levels, throw when an operation cannot complete due to exceptional circumstances. In middle...
Read more >yum/repos.py at master · rpm-software-management ... - GitHub
You should have received a copy of the GNU General Public License ... raise. self.disableRepo(repo.id). dl = False. if dl: mdtypes = repo....
Read more >Error handling for repository: exceptions or wrapping return ...
A frequent practice is to have methods with no return value ( void ). In this case, you have no choice but to...
Read more >Utilities - Hugging Face
If an input is not valid, a HFValidationError is thrown. Only the first non-valid value throws an error and stops the validation process....
Read more >Why does subscription-manager list return: "No Installed ...
Enable the repository and check for error. Raw. # subscription-manager repos --enable=REPO_ID REPO ID does not match a valid repository ID.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’d also definitely avoid
datasets/user/repo_name
. I don’t think it’ll break anything in the wild that we mentioned was supported. This should really be handled byrepo_type="dataset"
.Sounds good for validation!
(re last comment: it would have broken transformers, shame on me)