huggingface_hub 2.2.0: hf jobs stats prints a snapshot, and parallel downloads always use hf_xet

1 month ago

What changed in huggingface_hub 2.2.0: hf jobs stats prints one snapshot and exits, parallel downloads always use hf_xet, HfFileSystem caching fixes, Windows fixes for the hf command, and a new exception from load_torch_model. https://github.com/huggingface/huggingface_hub/releases/tag/v2.2.0 https://github.com/huggingface/huggingface_hub/compare/v2.1.1...v2.2.0

Ask about this presentation

Chapters

  1. 0:00hf jobs stats prints a snapshot
  2. 0:16The live view stays behind follow
  3. 0:27Snapshots for scripts and agents
  4. 0:39Logs and stats stop hanging
  5. 0:52Downloads
  6. 0:53Parallel downloads always use hf_xet
  7. 1:06A filter that matches zero files warns
  8. 1:19Offline, redirects, scheduled pushes
  9. 1:31HfFileSystem
  10. 1:33A new repo shows up
  11. 1:45Listings are replaced
  12. 1:58Empty buckets list as empty
  13. 2:07The hf command
  14. 2:08Windows passes patterns as typed
  15. 2:24Env files, uploads, cache cleanup
  16. 2:39hf_xet on Windows ARM64
  17. 2:51Exceptions
  18. 2:53load_torch_model raises FileNotFoundError
  19. 3:09Release notes
Show transcript
  1. huggingface_hub 2.2.0 changes hf jobs stats. Run it on a job and you get one reading of CPU, memory and GPU, then your prompt back. It used to stream until the job finished, so a script calling it on a running job hung until it timed out.

    Slide text
    01 02 03 04 05 hf jobs
    huggingface/huggingface_hub · GitHub release v2.2.0 · PR #5090
    Hugging Face

    huggingface_hub 2.2.0

    hf jobs stats prints the latest sample and exits

    Released October 8, 2026 Listed as breaking
  2. Hugging Face lists this as a breaking change, and scripts that relied on the stream can pass the follow option. The Python call fetch_job_metrics changed the same way.

    Slide text
    huggingface_hub 2.2.0
    01 02 03 04 05 hf jobs
    huggingface/huggingface_hub · GitHub release v2.2.0 · PR #5090

    The live view is still there, behind a follow option

    fetch_job_metrics in Python returns the current sample by default too

  3. The snapshot also comes in machine-readable formats. There's a JSON mode, an agent mode and a quiet mode, and they print the raw metrics that the Jobs API returns, instead of the table.

    Slide text
    huggingface_hub 2.2.0
    01 02 03 04 05 hf jobs
    huggingface/huggingface_hub · GitHub release v2.2.0

    A snapshot can print raw metrics for scripts and agents

    json agent quiet
  4. Logs without the follow option used to hang while a job kept printing, and now they return. Stats works when a listed job has finished, and its JSON output is an empty list when zero jobs are running.

    Slide text
    huggingface_hub 2.2.0
    01 02 03 04 05 hf jobs
    huggingface/huggingface_hub · GitHub release v2.2.0

    Logs return on time, and stats handles finished jobs

    hf jobs logs, hf spaces logs return without follow while the job keeps printing
    hf jobs stats works when one of the listed jobs has finished
    hf jobs stats --json prints [] when zero jobs are running
  5. Downloads.

    Slide text
    huggingface_hub 2.2.0
    01 02 03 04 05 Downloads
    02
    Downloads
  6. In a fresh process, the first parallel downloads could see a placeholder version for hf_xet and treat it as missing, so some files in a snapshot_download skipped Xet. Every download now sees the real version.

    Slide text
    huggingface_hub 2.2.0
    01 02 03 04 05 Downloads
    huggingface/huggingface_hub · GitHub release v2.2.0 · PR #5102

    In a fresh process, some snapshot_download files went over plain HTTP

  7. snapshot_download, and the hf download command, now print a warning when your allow or ignore patterns match zero files. Until now, a typo in a pattern looked exactly like a successful download.

    Slide text
    huggingface_hub 2.2.0
    01 02 03 04 05 Downloads
    huggingface/huggingface_hub · GitHub release v2.2.0 · PR #5067

    snapshot_download warns when a filter matches zero files

    A mistyped --include pattern used to look like a successful download

  8. An offline snapshot_download with a pinned revision now works. Following a resolve redirect keeps the port number. And CommitScheduler had a race that skipped its first scheduled push, which is fixed.

    Slide text
    huggingface_hub 2.2.0
    01 02 03 04 05 Downloads
    huggingface/huggingface_hub · GitHub release v2.2.0

    Offline downloads, redirects and scheduled pushes are fixed

    Offline snapshot_download works with a pinned revision
    Redirects from /resolve keep the port when followed
    CommitScheduler makes its first scheduled push
  9. HfFileSystem.

    Slide text
    huggingface_hub 2.2.0
    01 02 03 04 05 HfFileSystem
    03
    HfFileSystem
  10. HfFileSystem cached "not found" results. A repo, branch or bucket you created in the same process stayed missing until you cleared the whole cache. Now a refresh on that one path clears it.

    Slide text
    huggingface_hub 2.2.0
    01 02 03 04 05 HfFileSystem
    huggingface/huggingface_hub · GitHub release v2.2.0 · PR #5106

    A repo you just created now shows up in HfFileSystem

    A refresh on one path clears its cached “not found”

  11. Directory listings were appended to the cache, so a listing after a find call could show duplicate entries. A refresh kept deleted files, too. Each new listing now replaces the cached one.

    Slide text
    huggingface_hub 2.2.0
    01 02 03 04 05 HfFileSystem
    huggingface/huggingface_hub · GitHub release v2.2.0 · PR #5099

    Cached directory listings are replaced, so duplicates are gone

    A refresh also drops files that were deleted

  12. Listing a bucket you had just created, with zero files in it, used to raise FileNotFoundError. In 2.2.0 it returns an empty list.

    Slide text
    huggingface_hub 2.2.0
    01 02 03 04 05 HfFileSystem
    huggingface/huggingface_hub · GitHub release v2.2.0 · PR #5097

    Listing a new empty bucket returns an empty list

    It used to raise FileNotFoundError

  13. The hf command.

    Slide text
    huggingface_hub 2.2.0
    01 02 03 04 05 The hf command
    04
    The hf command
  14. On Windows, the hf command expanded quoted patterns into local file names. So a download filtered to JSON files, run in a folder that held a JSON file, quietly fetched zero files. Arguments now arrive as typed.

    Slide text
    huggingface_hub 2.2.0
    01 02 03 04 05 The hf command
    huggingface/huggingface_hub · GitHub release v2.2.0 · PR #5117

    On Windows, hf passes quoted patterns as typed

    hf download <repo> --include "*.json" in a folder with a JSON file downloaded zero files

  15. Env and secrets files are now read as UTF-8, with the byte order mark stripped. Upload takes an existing path with glob characters literally. And planning a cache cleanup no longer slows quadratically with the number of files in a revision.

    Slide text
    huggingface_hub 2.2.0
    01 02 03 04 05 The hf command
    huggingface/huggingface_hub · GitHub release v2.2.0

    hf reads env files as UTF‑8 and plans cache cleanup faster

    --env-file, --secrets-file read as UTF‑8, byte order mark stripped
    hf upload uploads an existing path with glob characters as is
    hf cache prune, hf cache rm planning no longer slows quadratically with file count
  16. On Windows ARM64 machines, Python reports the processor name in capitals, so the install rule missed it. Installing huggingface_hub there now pulls in hf_xet as well.

    Slide text
    huggingface_hub 2.2.0
    01 02 03 04 05 The hf command
    huggingface/huggingface_hub · GitHub release v2.2.0 · PR #5074

    hf_xet now installs on Windows ARM64

  17. Two exceptions change.

    Slide text
    huggingface_hub 2.2.0
    01 02 03 04 05 Exceptions
    05
    Exceptions
  18. Hugging Face lists this as breaking too. load_torch_model used to raise a value error when the checkpoint path didn't exist. Code that catches it is affected. And model_index_to_eval_results now raises a value error when you pass an empty list.

    Slide text
    huggingface_hub 2.2.0
    01 02 03 04 05 Exceptions
    huggingface/huggingface_hub · GitHub release v2.2.0 · PR #5063

    load_torch_model raises FileNotFoundError for a missing checkpoint

    Before ValueError
    model_index_to_eval_results raises ValueError on an empty list
  19. The 2.2.0 release notes on GitHub link every pull request behind these changes, and they point to the Jobs guide for the new snapshot output.

    Slide text
    huggingface_hub 2.2.0
    01 02 03 04 05 Release notes
    huggingface/huggingface_hub · GitHub release v2.2.0

    Every change is linked from the v2.2.0 release notes

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