Skip to content

[BUG+Workaround]: HTTP download progress callback fires only once per ~10 MB, making progress bars look frozen on home connections #4129

@tobocop2

Description

@tobocop2

Problem

This is about the HTTP transfer path (HF_HUB_DISABLE_XET=1). The xet path has a separate coarse-progress issue already tracked in #4058; I'm deliberately on HTTP because of that.

On HTTP, the progress callback passed via tqdm_class= on hf_hub_download / snapshot_download fires in very coarse intervals. On a ~1.5 MB/s home connection it fires roughly once every 7 seconds. A user watching a progress bar sees long silences between jumps (0 → 12 → 23 → …) and on small files may only see one update at the very end. The download is progressing fine — it just looks stalled. There's no env variable or public hook to change how often the callback fires.

Workaround I'm using

At package import, before any HF call, and with HF_HUB_DISABLE_XET=1:

from huggingface_hub import constants as _hf_constants
_hf_constants.DOWNLOAD_CHUNK_SIZE = 200 * 1024

With this, the callback fires several times per second at typical home-internet rates and progress animates smoothly. Overhead is negligible and it does not produce more network round-trips. I'm poking an internal constant, which isn't ideal, but it's the only lever I could find.

Sharing in case it helps anyone else running into the same thing.

Suggested fix

Expose a way to make progress callbacks fire more frequently — env variable, a progress_interval= / chunk_size= kwarg on the download functions, or simply a more frequent default. Anything that doesn't require downstream code to reach into internals.

Environment

  • huggingface_hub==1.11.0
  • Reproduces in any UI that renders the tqdm callback (Textual TUI, Jupyter, desktop GUIs).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions