`metadata_update` fails when README.md has no text content (but it has metadata)
See original GitHub issueDescribe the bug
metadata_update
fails when there is no newline after the YAML header.
I had a README.md file with the following 3 lines:
---
license: cc-by-sa-4.0
---
calling metadata_update("cakiki/abc", {"tag": "test"}, repo_type="dataset", overwrite=True)
throws TypeError: argument of type 'NoneType' is not iterable
.
I had to add a new line, i.e. content to the README for this to work.
Reproduction
No response
Logs
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
/tmp/ipykernel_117739/230484724.py in <module>
----> 1 metadata_update("cakiki/abc", {"tag": "test"}, 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)
199 # update all fields except model index
200 else:
--> 201 if key in existing_metadata and not overwrite:
202 if existing_metadata[key] != metadata[key]:
203 raise ValueError(
TypeError: argument of type 'NoneType' is not iterable
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:8 (8 by maintainers)
Top Results From Across the Web
Create simpler "readme =" under [project] instead of ... - GitHub
Summary I found a potential bug in pyproject-fmt where it misplaces a [project.readme] section in pyproject.toml leading to an error.
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 >Windows R CMD check top-level files: (README) [WARNING ...
I have activated GitHub Action to CI for R on Win, OSX, and Linux. On Windows only happen the following warning (which is...
Read more >ML Metadata | TFX - TensorFlow
ML Metadata (MLMD) is a library for recording and retrieving metadata associated with ML developer and data scientist workflows. MLMD is an ...
Read more >Access VM metadata - Compute Engine - Google Cloud
The metadata value you specified no longer exists. The metadata server also returns this error if your metadata is deleted while you are...
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
Oops, closed it automatically with the PR. Please open it again if necessary @cakiki
Seems that @nateraw already fixed it without knowing 😄 I created a PR to add a regression test but that’s it. Please let me know if I missed something.