Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -245,7 +245,8 @@ with gr.Blocks(css="""
|
|
| 245 |
.gr-textbox, .gr-dropdown, .gr-slider {border: 2px solid #D4A373 !important; border-radius: 10px !important; padding: 10px !important;}
|
| 246 |
.gr-image {border-radius: 15px; margin: auto; max-width: 200px;}
|
| 247 |
.footer {text-align: center; color: #808080; font-size: 0.9em; margin-top: 20px;}
|
| 248 |
-
.
|
|
|
|
| 249 |
""") as demo:
|
| 250 |
gr.HTML("""
|
| 251 |
<div style='background: linear-gradient(to right, #D4A373, #FEE440); padding: 20px; border-radius: 15px; text-align: center;'>
|
|
@@ -261,15 +262,13 @@ with gr.Blocks(css="""
|
|
| 261 |
choices=moods,
|
| 262 |
label="Mood",
|
| 263 |
value="happy",
|
| 264 |
-
elem_classes="gr-dropdown"
|
| 265 |
-
info="How are you feeling right now? Pick a mood that matches your vibe."
|
| 266 |
)
|
| 267 |
time_of_day = gr.Dropdown(
|
| 268 |
choices=times_of_day,
|
| 269 |
label="Time of Day",
|
| 270 |
value="morning",
|
| 271 |
-
elem_classes="gr-dropdown"
|
| 272 |
-
info="What time is it? This helps pick snacks that suit the moment."
|
| 273 |
)
|
| 274 |
hunger_level = gr.Slider(
|
| 275 |
minimum=0,
|
|
@@ -277,8 +276,7 @@ with gr.Blocks(css="""
|
|
| 277 |
step=0.1,
|
| 278 |
label="Hunger Level (0 to 1)",
|
| 279 |
value=0.5,
|
| 280 |
-
elem_classes="gr-slider"
|
| 281 |
-
info="How hungry are you? 0 = not hungry, 1 = starving!"
|
| 282 |
)
|
| 283 |
sentiment = gr.Slider(
|
| 284 |
minimum=-1,
|
|
@@ -286,15 +284,13 @@ with gr.Blocks(css="""
|
|
| 286 |
step=0.1,
|
| 287 |
label="Sentiment (-1 to 1)",
|
| 288 |
value=0.0,
|
| 289 |
-
elem_classes="gr-slider"
|
| 290 |
-
info="What's your emotional vibe? -1 = feeling down, 0 = neutral, +1 = super upbeat."
|
| 291 |
)
|
| 292 |
snack_type = gr.Dropdown(
|
| 293 |
choices=['sweet', 'savory', 'spicy', 'light'],
|
| 294 |
label="Snack Type",
|
| 295 |
value="sweet",
|
| 296 |
-
elem_classes="gr-dropdown"
|
| 297 |
-
info="What kind of snack do you crave? Sweet, savory, spicy, or light."
|
| 298 |
)
|
| 299 |
predict_btn = gr.Button("Find My Snack!", variant="primary", elem_classes="gr-button")
|
| 300 |
|
|
@@ -322,6 +318,14 @@ with gr.Blocks(css="""
|
|
| 322 |
)
|
| 323 |
|
| 324 |
gr.HTML("""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 325 |
<div class='footer'>
|
| 326 |
<p>Built with ❤️ by @teganmosi</p>
|
| 327 |
<p>Follow my #WeeklyMLProjects for more! 🍟</p>
|
|
|
|
| 245 |
.gr-textbox, .gr-dropdown, .gr-slider {border: 2px solid #D4A373 !important; border-radius: 10px !important; padding: 10px !important;}
|
| 246 |
.gr-image {border-radius: 15px; margin: auto; max-width: 200px;}
|
| 247 |
.footer {text-align: center; color: #808080; font-size: 0.9em; margin-top: 20px;}
|
| 248 |
+
.explanations {text-align: center; color: #4A2C2A; font-size: 0.9em; margin-top: 20px;}
|
| 249 |
+
.explanations p {margin: 5px 0; text-align: left; display: inline-block;}
|
| 250 |
""") as demo:
|
| 251 |
gr.HTML("""
|
| 252 |
<div style='background: linear-gradient(to right, #D4A373, #FEE440); padding: 20px; border-radius: 15px; text-align: center;'>
|
|
|
|
| 262 |
choices=moods,
|
| 263 |
label="Mood",
|
| 264 |
value="happy",
|
| 265 |
+
elem_classes="gr-dropdown"
|
|
|
|
| 266 |
)
|
| 267 |
time_of_day = gr.Dropdown(
|
| 268 |
choices=times_of_day,
|
| 269 |
label="Time of Day",
|
| 270 |
value="morning",
|
| 271 |
+
elem_classes="gr-dropdown"
|
|
|
|
| 272 |
)
|
| 273 |
hunger_level = gr.Slider(
|
| 274 |
minimum=0,
|
|
|
|
| 276 |
step=0.1,
|
| 277 |
label="Hunger Level (0 to 1)",
|
| 278 |
value=0.5,
|
| 279 |
+
elem_classes="gr-slider"
|
|
|
|
| 280 |
)
|
| 281 |
sentiment = gr.Slider(
|
| 282 |
minimum=-1,
|
|
|
|
| 284 |
step=0.1,
|
| 285 |
label="Sentiment (-1 to 1)",
|
| 286 |
value=0.0,
|
| 287 |
+
elem_classes="gr-slider"
|
|
|
|
| 288 |
)
|
| 289 |
snack_type = gr.Dropdown(
|
| 290 |
choices=['sweet', 'savory', 'spicy', 'light'],
|
| 291 |
label="Snack Type",
|
| 292 |
value="sweet",
|
| 293 |
+
elem_classes="gr-dropdown"
|
|
|
|
| 294 |
)
|
| 295 |
predict_btn = gr.Button("Find My Snack!", variant="primary", elem_classes="gr-button")
|
| 296 |
|
|
|
|
| 318 |
)
|
| 319 |
|
| 320 |
gr.HTML("""
|
| 321 |
+
<div class='explanations'>
|
| 322 |
+
<h3 style='color: #4A2C2A; font-size: 1.1em; margin-bottom: 10px;'>What do the inputs mean?</h3>
|
| 323 |
+
<p><strong>Mood:</strong> How are you feeling right now? Pick a mood that matches your vibe.</p>
|
| 324 |
+
<p><strong>Time of Day:</strong> What time is it? This helps pick snacks that suit the moment.</p>
|
| 325 |
+
<p><strong>Hunger Level:</strong> How hungry are you? 0 = not hungry, 1 = starving!</p>
|
| 326 |
+
<p><strong>Sentiment:</strong> What's your emotional vibe? -1 = feeling down, 0 = neutral, +1 = super upbeat.</p>
|
| 327 |
+
<p><strong>Snack Type:</strong> What kind of snack do you crave? Sweet, savory, spicy, or light.</p>
|
| 328 |
+
</div>
|
| 329 |
<div class='footer'>
|
| 330 |
<p>Built with ❤️ by @teganmosi</p>
|
| 331 |
<p>Follow my #WeeklyMLProjects for more! 🍟</p>
|