Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,7 +16,8 @@ async def classify_emotion(message: str):
|
|
| 16 |
emotions = api.Emotions()
|
| 17 |
try:
|
| 18 |
results = emotions.emotion(model_slug='Emotion-1.0', message=message)
|
| 19 |
-
|
|
|
|
| 20 |
except Exception as e:
|
| 21 |
return {"error": str(e)}
|
| 22 |
|
|
|
|
| 16 |
emotions = api.Emotions()
|
| 17 |
try:
|
| 18 |
results = emotions.emotion(model_slug='Emotion-1.0', message=message)
|
| 19 |
+
json_results = json.dumps(results, indent=4)
|
| 20 |
+
return json_results
|
| 21 |
except Exception as e:
|
| 22 |
return {"error": str(e)}
|
| 23 |
|