Skip to content

Commit 675e461

Browse files
committed
Remove aiohttp dependency (#3488)
* Remove aiohttp dependency * too fast
1 parent cd57d24 commit 675e461

File tree

2 files changed

+3
-17
lines changed

2 files changed

+3
-17
lines changed

setup.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,6 @@ def get_version() -> str:
2828

2929
extras = {}
3030

31-
extras["inference"] = [
32-
"aiohttp", # for AsyncInferenceClient
33-
]
34-
3531
extras["oauth"] = [
3632
"authlib>=1.3.2", # minimum version to include https://github.com/lepture/authlib/pull/644
3733
"fastapi",
@@ -54,11 +50,10 @@ def get_version() -> str:
5450
extras["mcp"] = [
5551
"mcp>=1.8.0",
5652
"typer",
57-
] + extras["inference"]
53+
]
5854

5955
extras["testing"] = (
60-
extras["inference"]
61-
+ extras["oauth"]
56+
extras["oauth"]
6257
+ [
6358
"jedi",
6459
"Jinja2",

src/huggingface_hub/inference/_common.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
ValidationError,
3636
)
3737

38-
from ..utils import get_session, is_aiohttp_available, is_numpy_available, is_pillow_available
38+
from ..utils import get_session, is_numpy_available, is_pillow_available
3939
from ._generated.types import ChatCompletionStreamOutput, TextGenerationStreamOutput
4040

4141

@@ -91,15 +91,6 @@ def __new__(cls, data: bytes, mime_type: Optional[str] = None):
9191
## IMPORT UTILS
9292

9393

94-
def _import_aiohttp():
95-
# Make sure `aiohttp` is installed on the machine.
96-
if not is_aiohttp_available():
97-
raise ImportError("Please install aiohttp to use `AsyncInferenceClient` (`pip install aiohttp`).")
98-
import aiohttp
99-
100-
return aiohttp
101-
102-
10394
def _import_numpy():
10495
"""Make sure `numpy` is installed on the machine."""
10596
if not is_numpy_available():

0 commit comments

Comments
 (0)