diff --git a/setup.py b/setup.py index 069651780f..89cb5a080b 100644 --- a/setup.py +++ b/setup.py @@ -74,7 +74,7 @@ def get_version() -> str: "urllib3<2.0", # VCR.py broken with urllib3 2.0 (see https://urllib3.readthedocs.io/en/stable/v2-migration-guide.html) "soundfile", "Pillow", - "gradio", # to test webhooks + "gradio>=4.0.0", # to test webhooks # pin to avoid issue on Python3.12 "numpy", # for embeddings "fastapi", # To build the documentation ] diff --git a/src/huggingface_hub/hub_mixin.py b/src/huggingface_hub/hub_mixin.py index 1e77fffb6b..4c504f26d0 100644 --- a/src/huggingface_hub/hub_mixin.py +++ b/src/huggingface_hub/hub_mixin.py @@ -17,6 +17,8 @@ Union, ) +import packaging.version + from . import constants from .errors import EntryNotFoundError, HfHubHTTPError from .file_download import hf_hub_download @@ -41,7 +43,6 @@ import torch # type: ignore if is_safetensors_available(): - import packaging.version import safetensors from safetensors.torch import load_model as load_model_as_safetensor from safetensors.torch import save_model as save_model_as_safetensor