Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -149,20 +149,24 @@ def analyze_emotion(input_text, uploaded_file=None):
|
|
| 149 |
def wellness_analyzer(input_text, uploaded_file=None):
|
| 150 |
emotion, tone_name, advice, audio_file = analyze_emotion(input_text, uploaded_file)
|
| 151 |
|
| 152 |
-
output =
|
| 153 |
<div style="font-family: Arial, sans-serif; line-height: 1.6;">
|
| 154 |
-
<h3 style="color: #4a4a4a;">Detected Emotional State: {
|
| 155 |
|
| 156 |
-
<p><strong>Recommended Tone:</strong> {
|
| 157 |
|
| 158 |
<p><strong>Personalized Advice:</strong></p>
|
| 159 |
<ol>
|
| 160 |
-
{
|
| 161 |
</ol>
|
| 162 |
|
| 163 |
<p><em>Listen to the generated audio file for a custom 30-second vibrational experience with subliminal messaging.</em></p>
|
| 164 |
</div>
|
| 165 |
-
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
| 166 |
|
| 167 |
return output, audio_file
|
| 168 |
|
|
|
|
| 149 |
def wellness_analyzer(input_text, uploaded_file=None):
|
| 150 |
emotion, tone_name, advice, audio_file = analyze_emotion(input_text, uploaded_file)
|
| 151 |
|
| 152 |
+
output = """
|
| 153 |
<div style="font-family: Arial, sans-serif; line-height: 1.6;">
|
| 154 |
+
<h3 style="color: #4a4a4a;">Detected Emotional State: {0}</h3>
|
| 155 |
|
| 156 |
+
<p><strong>Recommended Tone:</strong> {1}</p>
|
| 157 |
|
| 158 |
<p><strong>Personalized Advice:</strong></p>
|
| 159 |
<ol>
|
| 160 |
+
{2}
|
| 161 |
</ol>
|
| 162 |
|
| 163 |
<p><em>Listen to the generated audio file for a custom 30-second vibrational experience with subliminal messaging.</em></p>
|
| 164 |
</div>
|
| 165 |
+
""".format(
|
| 166 |
+
emotion.capitalize(),
|
| 167 |
+
tone_name,
|
| 168 |
+
"".join("<li>{0}</li>".format(advice_item.strip()) for advice_item in advice.split("\n") if advice_item.strip())
|
| 169 |
+
)
|
| 170 |
|
| 171 |
return output, audio_file
|
| 172 |
|