`metadata_update` fails when no README.md exists
See original GitHub issueDescribe the bug
metadata_update
cannot be called on a repo with no README.md file and throws the following exception:
EntryNotFoundError: 404 Client Error: Entry Not Found for url: https://huggingface.co/datasets/cakiki/abc/resolve/main/README.md. (Request ID: SWDb5XnCP0Ofk0koTZuva)
Reproduction
Create a dataset without choosing a license and call update_metadata
e.g.: metadata_update("cakiki/abc", {"license": "cc-by-sa-4.0"}, repo_type="dataset", overwrite=True)
Logs
---------------------------------------------------------------------------
EntryNotFoundError Traceback (most recent call last)
/tmp/ipykernel_117739/1604102178.py in <module>
----> 1 metadata_update("cakiki/abc", {"license": "cc-by-sa-4.0"}, repo_type="dataset", overwrite=True)
/media/ssd/BIGSCIENCE/env/lib/python3.7/site-packages/huggingface_hub/repocard.py in metadata_update(repo_id, metadata, repo_type, overwrite, token, commit_message, commit_description, revision, create_pr)
175 filename=REPOCARD_NAME,
176 repo_type=repo_type,
--> 177 use_auth_token=token,
178 )
179 # work on a copy of the upstream file, to not mess up the cache
/media/ssd/BIGSCIENCE/env/lib/python3.7/site-packages/huggingface_hub/file_download.py in hf_hub_download(repo_id, filename, subfolder, repo_type, revision, library_name, library_version, cache_dir, user_agent, force_download, force_filename, proxies, etag_timeout, resume_download, use_auth_token, local_files_only, legacy_cache_layout)
1018 timeout=etag_timeout,
1019 )
-> 1020 _raise_for_status(r)
1021 commit_hash = r.headers[HUGGINGFACE_HEADER_X_REPO_COMMIT]
1022 if commit_hash is None:
/media/ssd/BIGSCIENCE/env/lib/python3.7/site-packages/huggingface_hub/utils/_errors.py in _raise_for_status(request)
70 elif error_code == "EntryNotFound":
71 raise EntryNotFoundError(
---> 72 f"404 Client Error: Entry Not Found for url: {request.url}. (Request"
73 f" ID: {request_id})"
74 )
EntryNotFoundError: 404 Client Error: Entry Not Found for url: https://huggingface.co/datasets/cakiki/abc/resolve/main/README.md. (Request ID: SWDb5XnCP0Ofk0koTZuva)
System Info
- `transformers` version: 4.21.1
- Platform: Linux-5.15.0-46-generic-x86_64-with-glibc2.29
- Python version: 3.8.10
- Huggingface_hub version: 0.9.0.dev0
- PyTorch version (GPU?): 1.11.0+cu102 (True)
- Tensorflow version (GPU?): not installed (NA)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed
Issue Analytics
- State:
- Created a year ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
README not being detected, even though it exists in github ...
I just published a patch version of my package. The repo has a README, but my NPM package page can't find one: Sadly,...
Read more >How to get readme.md file that exists on a remote branch that I ...
This is my problem: I wrote a long readme.md file in github(for the first time in my life) and, as always, force pushed....
Read more >README not displayed if both README & README.md exist
If a directory contain both a README and a README.md file, neither file is displayed. This might also be true for other combinations...
Read more >Guide to writing "readme" style metadata
Guide to writing "readme" style metadata. A readme file provides information about a data file and is intended to help ensure that ...
Read more >Plugin Development - Gerrit Code Review
A plugin in Gerrit is tightly coupled code that runs in the same JVM as Gerrit. It has full access to all server...
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
What would you expect here, @cakiki ? I assume if no readme exists, we should just create a new card with the specified metadata and push that up with empty text content after it. WDYT?
cc @nateraw