Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,6 +9,12 @@ from huggingface_hub import hf_hub_download
|
|
| 9 |
from imgutils.data import load_image
|
| 10 |
from imgutils.utils import open_onnx_model
|
| 11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
_MODELS = [
|
| 13 |
('content_moderation.onnx', 224),
|
| 14 |
]
|
|
@@ -16,6 +22,13 @@ _MODEL_NAMES = [name for name, _ in _MODELS]
|
|
| 16 |
_DEFAULT_MODEL_NAME = _MODEL_NAMES[0]
|
| 17 |
_MODEL_TO_SIZE = dict(_MODELS)
|
| 18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
@lru_cache()
|
| 21 |
def _onnx_model(name):
|
|
|
|
| 9 |
from imgutils.data import load_image
|
| 10 |
from imgutils.utils import open_onnx_model
|
| 11 |
|
| 12 |
+
import gradio as gr
|
| 13 |
+
from huggingface_hub import hf_hub_download
|
| 14 |
+
from onnx import hub
|
| 15 |
+
import onnxruntime as ort
|
| 16 |
+
|
| 17 |
+
|
| 18 |
_MODELS = [
|
| 19 |
('content_moderation.onnx', 224),
|
| 20 |
]
|
|
|
|
| 22 |
_DEFAULT_MODEL_NAME = _MODEL_NAMES[0]
|
| 23 |
_MODEL_TO_SIZE = dict(_MODELS)
|
| 24 |
|
| 25 |
+
model = hub.load(hf_hub_download(
|
| 26 |
+
'tanlocc/Out_of_Universe',
|
| 27 |
+
f'{name}'
|
| 28 |
+
))
|
| 29 |
+
|
| 30 |
+
print(model)
|
| 31 |
+
|
| 32 |
|
| 33 |
@lru_cache()
|
| 34 |
def _onnx_model(name):
|