Upload folder using huggingface_hub
Browse files- app/hub.py +4 -1
app/hub.py
CHANGED
|
@@ -7,7 +7,10 @@ from dataclasses import dataclass
|
|
| 7 |
from pathlib import Path
|
| 8 |
from typing import Iterable
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
| 11 |
from huggingface_hub import (
|
| 12 |
batch_bucket_files,
|
| 13 |
bucket_info,
|
|
|
|
| 7 |
from pathlib import Path
|
| 8 |
from typing import Iterable
|
| 9 |
|
| 10 |
+
try: # huggingface_hub 2.x ships its own httpx fork; 1.x uses httpx itself.
|
| 11 |
+
import httpx2 as httpx # type: ignore[import-not-found]
|
| 12 |
+
except ImportError:
|
| 13 |
+
import httpx # httpx is not in requirements.txt: it comes with huggingface_hub
|
| 14 |
from huggingface_hub import (
|
| 15 |
batch_bucket_files,
|
| 16 |
bucket_info,
|