Spaces:
Sleeping
Sleeping
Add application file
Browse files
app.py
CHANGED
|
@@ -48,10 +48,7 @@ def predict():
|
|
| 48 |
predicted_class_idx = logits.argmax(-1).item()
|
| 49 |
print(model.config.id2label[predicted_class_idx])
|
| 50 |
# Return the predictions
|
| 51 |
-
|
| 52 |
-
response = Response(response)
|
| 53 |
-
response.headers['Content-Security-Policy'] = "script-src 'self' render.com;" # Modify this CSP as needed
|
| 54 |
-
return response
|
| 55 |
except:
|
| 56 |
return json.dumps({"Uh oh": "We are down"})
|
| 57 |
|
|
|
|
| 48 |
predicted_class_idx = logits.argmax(-1).item()
|
| 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 |
|