Skip to content

Commit c79e14b

Browse files
authored
Fix 2609 - Import packaging by default (#2610)
* Fix 2609 - Import packaging by default * pin gradio to high version in test * test
1 parent 9bb6bd6 commit c79e14b

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def get_version() -> str:
7474
"urllib3<2.0", # VCR.py broken with urllib3 2.0 (see https://urllib3.readthedocs.io/en/stable/v2-migration-guide.html)
7575
"soundfile",
7676
"Pillow",
77-
"gradio", # to test webhooks
77+
"gradio>=4.0.0", # to test webhooks # pin to avoid issue on Python3.12
7878
"numpy", # for embeddings
7979
"fastapi", # To build the documentation
8080
]

src/huggingface_hub/hub_mixin.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
Union,
1818
)
1919

20+
import packaging.version
21+
2022
from . import constants
2123
from .errors import EntryNotFoundError, HfHubHTTPError
2224
from .file_download import hf_hub_download
@@ -41,7 +43,6 @@
4143
import torch # type: ignore
4244

4345
if is_safetensors_available():
44-
import packaging.version
4546
import safetensors
4647
from safetensors.torch import load_model as load_model_as_safetensor
4748
from safetensors.torch import save_model as save_model_as_safetensor

0 commit comments

Comments
 (0)