Skip to content

Huggingface Cache Manager extension broken with huggingface_hub >= 1.0 (No module named 'huggingface_hub.commands') #670

Description

@kusayuzayushko

Summary

The built-in extension_huggingface_cache_manager extension fails to load when huggingface_hub >= 1.0 is installed, because it imports a private path that was removed in HF Hub 1.0.

requirements.txt does not pin huggingface_hub, so a fresh install (e.g. via Docker) pulls in 1.13.0 transitively and the tab is broken out-of-the-box.

Stacktrace

Loading Huggingface Cache Manager.............Failed to load Huggingface Cache Manager tab. Please check your configuration.
Error: No module named 'huggingface_hub.commands'
Traceback (most recent call last):
  File "/app/tts-webui/tts_webui/extensions_loader/interface_extensions.py", line 134, in _handle_package
    module = importlib.import_module(f"{package_name}.main")
  ...
  File "/app/tts-webui/extensions/builtin/extension_huggingface_cache_manager/scan_cache.py", line 27, in <module>
    from huggingface_hub.commands._cli_utils import ANSI, tabulate
ModuleNotFoundError: No module named 'huggingface_hub.commands'

Root cause

extensions/builtin/extension_huggingface_cache_manager/scan_cache.py:27 imports a private submodule:

from huggingface_hub.commands._cli_utils import ANSI, tabulate

huggingface_hub.commands was reorganized in huggingface_hub 1.0 — the commands package (and its private _cli_utils) is no longer present. Latest is 1.13.0.

Reproduction

  1. Fresh install of tts-webui main branch (any environment that resolves huggingface_hub from PyPI without an explicit pin).
  2. Start the server.
  3. Observe the cache manager tab fails to load with the traceback above.

The rest of the app loads fine — only this one extension is affected.

Environment

  • OS: Ubuntu 22.04 (Docker container, nvidia/cuda:12.8.0-devel-ubuntu22.04)
  • Python: 3.10
  • huggingface_hub: 1.13.0 (latest)
  • tts-webui: main

Possible fixes

  1. Update the import to whatever the new path is in HF Hub 1.x (e.g. under huggingface_hub.cli if equivalents were moved there), with a fallback for older versions.
  2. Vendor the ANSI and tabulate helpers — they're tiny utilities and depending on a private path was always brittle.
  3. Stopgap: add huggingface_hub<1.0 to requirements.txt until the import is updated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions