question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Should throw an error if `repo_id` is not valid

See original GitHub issue

Related 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:closed
  • Created a year ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
LysandreJikcommented, Aug 24, 2022

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 by repo_type="dataset".

Sounds good for validation!

0reactions
LysandreJikcommented, Sep 5, 2022

(re last comment: it would have broken transformers, shame on me)

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found