DreamStream-1 commited on
Commit
8d2c563
·
verified ·
1 Parent(s): 3218176

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -194,7 +194,7 @@ def recommendations_interface(emotion):
194
 
195
  # Gradio interface
196
  with gr.Blocks() as demo:
197
- gr.Markdown("# Mental Health Assistant")
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
- return predict_emotion(text)
 
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):