Spaces:
Runtime error
Runtime error
Add error handle for loading model
Browse files
app.py
CHANGED
@@ -118,8 +118,12 @@ def query(payload):
|
|
118 |
|
119 |
def predict(text):
|
120 |
print(preprocess(text))
|
121 |
-
|
122 |
-
|
|
|
|
|
|
|
|
|
123 |
output = [tuple(i.values()) for i in output]
|
124 |
output = dict((x, y) for x, y in output)
|
125 |
|
|
|
118 |
|
119 |
def predict(text):
|
120 |
print(preprocess(text))
|
121 |
+
|
122 |
+
try:
|
123 |
+
output = query(preprocess(text))[0]
|
124 |
+
except Exception:
|
125 |
+
print(output)
|
126 |
+
|
127 |
output = [tuple(i.values()) for i in output]
|
128 |
output = dict((x, y) for x, y in output)
|
129 |
|