Skip to content

Fix TqdmKeyError on checkpoint download with huggingface_hub >=1.4#19

Open
vasanth15-hts wants to merge 2 commits into
openai:mainfrom
vasanth15-hts:fix/hf-tqdm-name-kwarg
Open

Fix TqdmKeyError on checkpoint download with huggingface_hub >=1.4#19
vasanth15-hts wants to merge 2 commits into
openai:mainfrom
vasanth15-hts:fix/hf-tqdm-name-kwarg

Conversation

@vasanth15-hts
Copy link
Copy Markdown

Summary

  • OpfDownloadTqdm now inherits from huggingface_hub.utils.tqdm, which strips the name= kwarg that newer huggingface_hub (≥1.4) passes into snapshot_download's tqdm class.
  • Without this, opf <text> crashes on first run with TqdmKeyError: "Unknown argument(s): {'name': 'huggingface_hub.snapshot_download'}" before the checkpoint can be downloaded.

Test plan

  • rm -rf ~/.opf/privacy_filter && opf --device cpu "Alice was born on 1990-01-02." — downloads checkpoint and prints Alice was born on <PRIVATE_DATE>.
  • huggingface_hub==1.4.1, tqdm==4.67.1, Python 3.14, macOS

Vasanthakumar R added 2 commits April 24, 2026 16:38
  Newer huggingface_hub (>=1.4) passes name='huggingface_hub.snapshot_download'
  into the tqdm class. The hf utils tqdm strips that kwarg; plain tqdm.auto
  does not, so the custom OpfDownloadTqdm crashed with TqdmKeyError. Rebase
  on hf's tqdm so the kwarg is consumed and progress-bar disable flags are
  still honored.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant