huggingface_hub v2.4.0 copies files into Buckets and flags outdated CLI extensions

1 hour ago

huggingface_hub v2.4.0: HfFileSystem copies files into Hugging Face Buckets (Xet files copy on the Hub with no download, and mv and rename now work inside a Bucket), hf extensions list shows outdated CLI extensions, hf extensions update repairs broken Python extensions, plus fixes for webhooks, cache lookups and hf cache verify. https://github.com/huggingface/huggingface_hub/releases/tag/v2.4.0 https://github.com/huggingface/huggingface_hub/compare/v2.3.0...v2.4.0

Ask about this presentation

Chapters

  1. 0:00Copy files into Buckets
  2. 0:12Three places a copy can start
  3. 0:22Xet files copy on the Hub
  4. 0:34Move and rename inside a Bucket
  5. 0:46Bucket to repo is not supported yet
  6. 0:5502: CLI extensions
  7. 0:57hf extensions list shows versions
  8. 1:09Outdated extensions say so
  9. 1:23hf extensions update repairs Python extensions
  10. 1:3603: Fixes
  11. 1:38Repository not found asks about auth
  12. 1:52Webhooks can watch discussions
  13. 2:03Cache lookups stay inside the cache
  14. 2:17Three more fixes
  15. 2:31Keep data in Buckets? Pick up 2.4.0
Show transcript
  1. In huggingface_hub 2.4, HfFileSystem copies files into a Bucket. Until now, any copy that touched a Bucket stopped with a not implemented error.

    Slide text
    01 02 03 Buckets
    huggingface/huggingface_hub · GitHub release notes v2.4.0 · #5080
    Hugging Face

    huggingface_hub v2.4.0 copies files into Buckets

    before: NotImplementedError now: copied
  2. The copy can start inside the same Bucket, in a different Bucket, or in a model, dataset or Space repo, so a dataset can land in a Bucket in one call.

    Slide text
    huggingface_hub v2.4.0
    01 02 03 Buckets
    huggingface/huggingface_hub · GitHub release notes v2.4.0 · #5080

    Copy into a Bucket from anywhere on the Hub

    The same Bucket a backup beside the original
    Another Bucket Bucket to Bucket
    A model, dataset or Space repo straight into the Bucket
  3. Files stored with Xet are copied on the Hub by their hash, so nothing comes down to your machine. Other repo files are downloaded first, then uploaded to the Bucket.

    Slide text
    huggingface_hub v2.4.0
    01 02 03 Buckets
    huggingface/huggingface_hub · GitHub release notes v2.4.0 · #5080

    Xet files are copied on the Hub

    Stored with Xet copied by hash, nothing downloaded
    Other repo files downloaded, then uploaded to the Bucket
  4. fsspec moves a file by copying it and then deleting the source. So with copies working, moving and renaming files inside a Bucket work too.

    Slide text
    huggingface_hub v2.4.0
    01 02 03 Buckets
    huggingface/huggingface_hub · GitHub release notes v2.4.0 · #5080

    mv and rename work inside a Bucket

    hffs.mv(
      "buckets/me/my-bucket/data/tmp.csv",
      "buckets/me/my-bucket/data/final.csv",
    )
  5. Copies only go one way for now. Copying from a Bucket back into a model, dataset or Space repo is not supported yet.

    Slide text
    huggingface_hub v2.4.0
    01 02 03 Buckets
    huggingface/huggingface_hub · GitHub release notes v2.4.0 · #5080

    Bucket to repo: not yet

    Copies go into Buckets. Copying from a Bucket to a model, dataset or Space repo is not supported yet.

  6. Extensions for the hf command.

    Slide text
    huggingface_hub v2.4.0
    01 02 03 CLI extensions
    02
    CLI extensions
  7. The extensions list only showed when each extension was installed. Now it adds the installed version, the latest one, and a hint naming every extension that's out of date.

    Slide text
    huggingface_hub v2.4.0
    01 02 03 CLI extensions
    huggingface/huggingface_hub · GitHub release notes v2.4.0 · #5269

    hf extensions list shows what's outdated

    hf extensions list showing the VERSION and LATEST columns and a hint for outdated extensions
  8. Running an outdated extension prints a hint, at most once a day. The latest version is checked once a day too, to stay within GitHub's rate limits. One environment variable turns the checks off.

    Slide text
    huggingface_hub v2.4.0
    01 02 03 CLI extensions
    huggingface/huggingface_hub · GitHub release notes v2.4.0 · #5269

    An outdated extension says so when it runs

    Running one prints a hint, at most once a day
    Latest commit looked up once a day, within GitHub's rate limits
    HF_HUB_DISABLE_UPDATE_CHECK=1 turns the checks off
  9. When a Homebrew upgrade removed the Python an extension was installed with, the extension stopped starting, and update said it was current. Now update rebuilds its virtual environment, even with no newer commit.

    Slide text
    huggingface_hub v2.4.0
    01 02 03 CLI extensions
    huggingface/huggingface_hub · GitHub release notes v2.4.0 · #5270

    hf extensions update repairs broken Python extensions

    $ hf extensions update speedtest
    Creating virtualenv at: ~/.local/share/hf/extensions/hf-speedtest/venv
    ✓ Extension updated
  10. Fixes you may have hit.

    Slide text
    huggingface_hub v2.4.0
    01 02 03 Fixes
    03
    Fixes
  11. Opening a private repo through HfFileSystem without a token gave the same not found error as a typo in its name. The error now also tells you to check that you're logged in.

    Slide text
    huggingface_hub v2.4.0
    01 02 03 Fixes
    huggingface/huggingface_hub · GitHub release notes v2.4.0 · #5258

    "Repository not found" now asks about your token

    A private repo opened without a token gave the same error as a typo in the repo name. The error now also tells you to check that you are authenticated.

  12. Creating a webhook from the command line failed unless you named the repo domain, and discussions could not be watched at all. Now a new webhook watches both by default.

    Slide text
    huggingface_hub v2.4.0
    01 02 03 Fixes
    huggingface/huggingface_hub · GitHub release notes v2.4.0 · #5263
    hf webhooks create failed unless you passed --domain repo
    discussion the accepted value was discussions, so discussions could not be watched
    create_webhook watches both domains when you name none
  13. A filename that pointed at a parent folder, or an absolute path, could make a cache lookup resolve outside the cache folder. Those names are now rejected, the way downloads already rejected them.

    Slide text
    huggingface_hub v2.4.0
    01 02 03 Fixes
    huggingface/huggingface_hub · GitHub release notes v2.4.0 · #5249

    try_to_load_from_cache now rejects filenames with ../ or an absolute path, as hf_hub_download already did.

  14. Finding a single file with details returned nothing, which broke datatrove readers. Cache verify flagged its own metadata as extra files. And on Windows, it crashed when its output was piped.

    Slide text
    huggingface_hub v2.4.0
    01 02 03 Fixes
    huggingface/huggingface_hub · GitHub release notes v2.4.0 · #5246 · #5257 · #5255

    Three fixes you may have hit

    find(detail=True) on one file returned an empty dict, breaking datatrove readers
    hf cache verify --local-dir flagged its own metadata as extra files
    hf cache verify on Windows crashed when output was piped or redirected
  15. If you keep data in Buckets, I'd upgrade for the copy alone: files stored with Xet land there without a download. The full list is in the 2.4 release notes on GitHub.

    Slide text
    huggingface_hub v2.4.0
    01 02 03 Fixes
    huggingface/huggingface_hub · GitHub release notes v2.4.0

    Keep data in Buckets? Pick up v2.4.0

    Release notes: github.com/huggingface/huggingface_hub › Releases › v2.4.0

What happened in AI today, in your inbox

One short email each evening. Read it and you’re caught up.

Built with ❤️ in New York