Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -194,7 +194,7 @@ def recommendations_interface(emotion):
|
|
194 |
|
195 |
# Gradio interface
|
196 |
with gr.Blocks() as demo:
|
197 |
-
gr.Markdown("#
|
198 |
|
199 |
# User input for text (emotion detection)
|
200 |
user_input_emotion = gr.Textbox(lines=1, label="How are you feeling today?")
|
@@ -202,7 +202,8 @@ with gr.Blocks() as demo:
|
|
202 |
|
203 |
# Model prediction for emotion detection
|
204 |
def predict_emotion(text):
|
205 |
-
|
|
|
206 |
|
207 |
# Show suggestions based on the detected emotion
|
208 |
def show_suggestions(emotion):
|
|
|
194 |
|
195 |
# Gradio interface
|
196 |
with gr.Blocks() as demo:
|
197 |
+
gr.Markdown("# Well-Being Assistant")
|
198 |
|
199 |
# User input for text (emotion detection)
|
200 |
user_input_emotion = gr.Textbox(lines=1, label="How are you feeling today?")
|
|
|
202 |
|
203 |
# Model prediction for emotion detection
|
204 |
def predict_emotion(text):
|
205 |
+
result = emotion_pipeline(text)
|
206 |
+
return result[0]['label']
|
207 |
|
208 |
# Show suggestions based on the detected emotion
|
209 |
def show_suggestions(emotion):
|