Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,6 +2,9 @@ import streamlit as st
|
|
| 2 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
| 3 |
from transformers import pipeline
|
| 4 |
|
|
|
|
|
|
|
|
|
|
| 5 |
# Load pre-trained model and tokenizer
|
| 6 |
@st.cache_resource
|
| 7 |
def load_model():
|
|
@@ -11,9 +14,6 @@ def load_model():
|
|
| 11 |
|
| 12 |
tokenizer, model = load_model()
|
| 13 |
|
| 14 |
-
# Set page configuration
|
| 15 |
-
st.set_page_config(page_title="Emotion Detection and Well-Being Suggestions", layout="wide")
|
| 16 |
-
|
| 17 |
# Add a background image (use your own URL or file path here)
|
| 18 |
st.markdown(
|
| 19 |
"""
|
|
@@ -115,4 +115,3 @@ if user_input:
|
|
| 115 |
st.write("[Dealing with Anxiety](https://www.helpguide.org/mental-health/anxiety/tips-for-dealing-with-anxiety)")
|
| 116 |
elif emotion == 'surprise':
|
| 117 |
st.write("[Managing Stress](https://www.health.harvard.edu/health-a-to-z)")
|
| 118 |
-
|
|
|
|
| 2 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
| 3 |
from transformers import pipeline
|
| 4 |
|
| 5 |
+
# Set page configuration - MUST be the first command
|
| 6 |
+
st.set_page_config(page_title="Emotion Detection and Well-Being Suggestions", layout="wide")
|
| 7 |
+
|
| 8 |
# Load pre-trained model and tokenizer
|
| 9 |
@st.cache_resource
|
| 10 |
def load_model():
|
|
|
|
| 14 |
|
| 15 |
tokenizer, model = load_model()
|
| 16 |
|
|
|
|
|
|
|
|
|
|
| 17 |
# Add a background image (use your own URL or file path here)
|
| 18 |
st.markdown(
|
| 19 |
"""
|
|
|
|
| 115 |
st.write("[Dealing with Anxiety](https://www.helpguide.org/mental-health/anxiety/tips-for-dealing-with-anxiety)")
|
| 116 |
elif emotion == 'surprise':
|
| 117 |
st.write("[Managing Stress](https://www.health.harvard.edu/health-a-to-z)")
|
|
|