tanlocc commited on
Commit
f67fcbe
Β·
1 Parent(s): 1ad6fe0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -9,7 +9,7 @@ from imgutils.data import load_image
9
  from imgutils.utils import open_onnx_model
10
 
11
  _MODELS = [
12
- ('content_moderation_opset15.onnx', 224),
13
  ]
14
  _MODEL_NAMES = [name for name, _ in _MODELS]
15
  _DEFAULT_MODEL_NAME = _MODEL_NAMES[0]
@@ -18,8 +18,10 @@ _MODEL_TO_SIZE = dict(_MODELS)
18
 
19
  @lru_cache()
20
  def _onnx_model(name):
21
- return open_onnx_model(f"main/content_moderation_opset15.onnx")
22
-
 
 
23
 
24
  def _image_preprocess(image, size: int = 224) -> np.ndarray:
25
  image = load_image(image, mode='RGB').resize((size, size), Image.NEAREST)
 
9
  from imgutils.utils import open_onnx_model
10
 
11
  _MODELS = [
12
+ ('content_moderation.onnx', 224),
13
  ]
14
  _MODEL_NAMES = [name for name, _ in _MODELS]
15
  _DEFAULT_MODEL_NAME = _MODEL_NAMES[0]
 
18
 
19
  @lru_cache()
20
  def _onnx_model(name):
21
+ return open_onnx_model(hf_hub_download(
22
+ 'tanlocc/Out_of_Universe',
23
+ f'{name}'
24
+ ))
25
 
26
  def _image_preprocess(image, size: int = 224) -> np.ndarray:
27
  image = load_image(image, mode='RGB').resize((size, size), Image.NEAREST)