manikumargouni commited on
Commit
32b3543
·
verified ·
1 Parent(s): 916a09e

Upload iab_classifier.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. iab_classifier.py +8 -3
iab_classifier.py CHANGED
@@ -4,9 +4,14 @@ from functools import lru_cache
4
 
5
  import torch
6
 
7
- from config import IAB_PARENT_FALLBACK_CONFIDENCE_FLOOR
8
- from iab_taxonomy import get_iab_taxonomy, parse_path_label, path_to_label
9
- from model_runtime import get_head
 
 
 
 
 
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: