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.

`metadata_update` fails when README.md has no text content (but it has metadata)

See original GitHub issue

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

github_iconTop GitHub Comments

1reaction
Wauplincommented, Sep 20, 2022

Oops, closed it automatically with the PR. Please open it again if necessary @cakiki

1reaction
Wauplincommented, Sep 16, 2022

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.

Read more comments on GitHub >

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

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