Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -2,6 +2,7 @@ import os
|
|
2 |
import gradio as gr
|
3 |
import nltk
|
4 |
import numpy as np
|
|
|
5 |
import tflearn
|
6 |
import random
|
7 |
import json
|
@@ -16,6 +17,9 @@ import torch
|
|
16 |
# Disable GPU usage for TensorFlow
|
17 |
os.environ['CUDA_VISIBLE_DEVICES'] = '-1'
|
18 |
|
|
|
|
|
|
|
19 |
# Ensure necessary NLTK resources are downloaded
|
20 |
nltk.download('punkt')
|
21 |
|
@@ -157,13 +161,7 @@ def generate_suggestions(emotion):
|
|
157 |
],
|
158 |
'sadness': [
|
159 |
{"Title": "Overcoming Sadness π", "Subject": "Well-being", "Link": '<a href="https://www.helpguide.org/mental-health/depression.htm" target="_blank">Overcoming Sadness</a>'},
|
160 |
-
{"Title": "Self-
|
161 |
-
{"Title": "Managing Grief π", "Subject": "Grief Management", "Link": '<a href="https://www.helpguide.org/mental-health/grief.htm" target="_blank">HelpGuide on Grief</a>'},
|
162 |
-
{"Title": "Mindfulness & Meditation π", "Subject": "Meditation", "Link": '<a href="https://www.meditationandmindfulness.com" target="_blank">Mindfulness & Meditation</a>'}
|
163 |
-
],
|
164 |
-
'fear': [
|
165 |
-
{"Title": "Managing Fear & Anxiety π‘", "Subject": "Mental Health", "Link": '<a href="https://www.psychologytoday.com/us/articles/anxiety" target="_blank">Psychology Today on Anxiety</a>'},
|
166 |
-
{"Title": "Building Confidence πͺ", "Subject": "Self-Confidence", "Link": '<a href="https://www.helpguide.org/mental-health/self-confidence.htm" target="_blank">Self-Confidence Guide</a>'},
|
167 |
{"Title": "Breathing Exercises π§ββοΈ", "Subject": "Breathing", "Link": '<a href="https://www.helpguide.org/mental-health/meditation/mindful-breathing-meditation" target="_blank">Mindful Breathing Meditation</a>'},
|
168 |
{"Title": "Relaxation Tips πΏ", "Subject": "Relaxation", "Link": '<a href="https://www.helpguide.org/mental-health/stress-relief.htm" target="_blank">Stress Relief Tips</a>'}
|
169 |
]
|
|
|
2 |
import gradio as gr
|
3 |
import nltk
|
4 |
import numpy as np
|
5 |
+
import tensorflow as tf
|
6 |
import tflearn
|
7 |
import random
|
8 |
import json
|
|
|
17 |
# Disable GPU usage for TensorFlow
|
18 |
os.environ['CUDA_VISIBLE_DEVICES'] = '-1'
|
19 |
|
20 |
+
# Suppress warnings related to missing CUDA libraries
|
21 |
+
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
|
22 |
+
|
23 |
# Ensure necessary NLTK resources are downloaded
|
24 |
nltk.download('punkt')
|
25 |
|
|
|
161 |
],
|
162 |
'sadness': [
|
163 |
{"Title": "Overcoming Sadness π", "Subject": "Well-being", "Link": '<a href="https://www.helpguide.org/mental-health/depression.htm" target="_blank">Overcoming Sadness</a>'},
|
164 |
+
{"Title": "Building Self-Esteem πͺ", "Subject": "Confidence", "Link": '<a href="https://www.helpguide.org/mental-health/self-confidence.htm" target="_blank">Self-Confidence Guide</a>'},
|
|
|
|
|
|
|
|
|
|
|
|
|
165 |
{"Title": "Breathing Exercises π§ββοΈ", "Subject": "Breathing", "Link": '<a href="https://www.helpguide.org/mental-health/meditation/mindful-breathing-meditation" target="_blank">Mindful Breathing Meditation</a>'},
|
166 |
{"Title": "Relaxation Tips πΏ", "Subject": "Relaxation", "Link": '<a href="https://www.helpguide.org/mental-health/stress-relief.htm" target="_blank">Stress Relief Tips</a>'}
|
167 |
]
|