Spaces:
Sleeping
Sleeping
Add application file
Browse files
app.py
CHANGED
@@ -49,6 +49,6 @@ def predict():
|
|
49 |
print(model.config.id2label[predicted_class_idx])
|
50 |
# Return the predictions
|
51 |
return json.dumps({"class": model.config.id2label[predicted_class_idx]})
|
52 |
-
except:
|
|
|
53 |
return json.dumps({"Uh oh": "We are down"})
|
54 |
-
|
|
|
49 |
print(model.config.id2label[predicted_class_idx])
|
50 |
# Return the predictions
|
51 |
return json.dumps({"class": model.config.id2label[predicted_class_idx]})
|
52 |
+
except Exception as e:
|
53 |
+
print(f"An error occurred: {str(e)}")
|
54 |
return json.dumps({"Uh oh": "We are down"})
|
|