Spaces:
Sleeping
Sleeping
vighnesh-shetty-vs commited on
Commit ·
b746835
1
Parent(s): ad0eb53
Add updated files
Browse files
app.py
CHANGED
|
@@ -243,20 +243,25 @@ h1 { text-align: center; color: #38bdf8; text-shadow: 0 0 15px rgba(56, 189, 248
|
|
| 243 |
.custom-dropdown { background: rgba(30, 41, 59, 0.8) !important; border: 1px solid #38bdf8 !important; border-radius: 12px !important; }
|
| 244 |
"""
|
| 245 |
|
|
|
|
|
|
|
| 246 |
with gr.Blocks(title="EcoQueryQuest") as demo:
|
|
|
|
| 247 |
game_state = gr.State({
|
| 248 |
-
"water":
|
| 249 |
"history": [], "game_over": False, "current_best_alt": None, "current_shuffled_alts": []
|
| 250 |
})
|
| 251 |
|
| 252 |
gr.Markdown("<h1>🌍 EcoQueryQuest</h1>")
|
| 253 |
gr.Markdown("<div class='subtitle'>Select a model, type a query, and watch Drip react. Reach 500 points to win!</div>")
|
| 254 |
|
| 255 |
-
|
|
|
|
| 256 |
|
| 257 |
with gr.Row():
|
| 258 |
with gr.Column(scale=1, elem_classes=["drip-pod"]):
|
| 259 |
-
|
|
|
|
| 260 |
drip_audio = gr.Audio(label="Drip's Voice", autoplay=True, interactive=False, elem_classes=["drip-audio"])
|
| 261 |
drip_feedback = gr.HTML("<div class='feedback-box'>Waiting for your first query...</div>")
|
| 262 |
|
|
@@ -277,7 +282,6 @@ with gr.Blocks(title="EcoQueryQuest") as demo:
|
|
| 277 |
alt_btn_3 = gr.Button("", elem_classes=["alt-card"])
|
| 278 |
alt_feedback = gr.Markdown()
|
| 279 |
|
| 280 |
-
# NOTE: Added user_input to the outputs list so we can update/clear it
|
| 281 |
submit_btn.click(
|
| 282 |
fn=process_query,
|
| 283 |
inputs=[user_input, model_selector, game_state],
|
|
|
|
| 243 |
.custom-dropdown { background: rgba(30, 41, 59, 0.8) !important; border: 1px solid #38bdf8 !important; border-radius: 12px !important; }
|
| 244 |
"""
|
| 245 |
|
| 246 |
+
# ... (Keep all your CSS, HTML, and helper functions above exactly the same) ...
|
| 247 |
+
|
| 248 |
with gr.Blocks(title="EcoQueryQuest") as demo:
|
| 249 |
+
# 1. Update the starting game state to 10.0 Liters
|
| 250 |
game_state = gr.State({
|
| 251 |
+
"water": 10.0, "energy": 0.0, "co2": 0.0, "points": 0, "queries": 0,
|
| 252 |
"history": [], "game_over": False, "current_best_alt": None, "current_shuffled_alts": []
|
| 253 |
})
|
| 254 |
|
| 255 |
gr.Markdown("<h1>🌍 EcoQueryQuest</h1>")
|
| 256 |
gr.Markdown("<div class='subtitle'>Select a model, type a query, and watch Drip react. Reach 500 points to win!</div>")
|
| 257 |
|
| 258 |
+
# 2. Update the initial stats HTML render to 10.0 Liters
|
| 259 |
+
stats_html = gr.HTML(get_stats_html(10.0, 0.0, 0.0, 0))
|
| 260 |
|
| 261 |
with gr.Row():
|
| 262 |
with gr.Column(scale=1, elem_classes=["drip-pod"]):
|
| 263 |
+
# 3. Update the initial Drip visual render to 10.0 Liters
|
| 264 |
+
drip_html = gr.HTML(get_drip_visuals(10.0))
|
| 265 |
drip_audio = gr.Audio(label="Drip's Voice", autoplay=True, interactive=False, elem_classes=["drip-audio"])
|
| 266 |
drip_feedback = gr.HTML("<div class='feedback-box'>Waiting for your first query...</div>")
|
| 267 |
|
|
|
|
| 282 |
alt_btn_3 = gr.Button("", elem_classes=["alt-card"])
|
| 283 |
alt_feedback = gr.Markdown()
|
| 284 |
|
|
|
|
| 285 |
submit_btn.click(
|
| 286 |
fn=process_query,
|
| 287 |
inputs=[user_input, model_selector, game_state],
|