Upload iab_classifier.py with huggingface_hub
Browse files- iab_classifier.py +8 -3
iab_classifier.py
CHANGED
|
@@ -4,9 +4,14 @@ from functools import lru_cache
|
|
| 4 |
|
| 5 |
import torch
|
| 6 |
|
| 7 |
-
|
| 8 |
-
from
|
| 9 |
-
from
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
|
| 12 |
def round_score(value: float) -> float:
|
|
|
|
| 4 |
|
| 5 |
import torch
|
| 6 |
|
| 7 |
+
try:
|
| 8 |
+
from .config import IAB_PARENT_FALLBACK_CONFIDENCE_FLOOR # type: ignore
|
| 9 |
+
from .iab_taxonomy import get_iab_taxonomy, parse_path_label, path_to_label # type: ignore
|
| 10 |
+
from .model_runtime import get_head # type: ignore
|
| 11 |
+
except ImportError:
|
| 12 |
+
from config import IAB_PARENT_FALLBACK_CONFIDENCE_FLOOR
|
| 13 |
+
from iab_taxonomy import get_iab_taxonomy, parse_path_label, path_to_label
|
| 14 |
+
from model_runtime import get_head
|
| 15 |
|
| 16 |
|
| 17 |
def round_score(value: float) -> float:
|