vighnesh-shetty-vs commited on
Commit
6b74501
·
1 Parent(s): a27643c

Add updated files

Browse files
Files changed (1) hide show
  1. app.py +9 -3
app.py CHANGED
@@ -352,7 +352,8 @@ def process_query(user_input, selected_model, state):
352
  feedback_text = f"<div class='feedback-box'>🧠 <strong>{category.upper()}</strong> Detected!<br><br><em>\"{dialogue}\"</em></div>"
353
 
354
  # WIN CONDITION
355
- if state["points"] >= 500:
 
356
  state["game_over"] = True
357
  return (state, stats_ui, drip_ui, audio_path, impact_ui, gr.update(), gr.update(visible=False),
358
  gr.update(), gr.update(), gr.update(), gr.update(), gr.update(value=""),
@@ -460,8 +461,12 @@ h1 { text-align: center; color: #38bdf8; text-shadow: 0 0 15px rgba(56, 189, 248
460
 
461
  with gr.Blocks(css=custom_css, title="EcoQueryQuest") as demo:
462
  # 1. State initialized with 10.0L
 
 
 
 
463
  game_state = gr.State({
464
- "water": 10.0, "energy": 0.0, "co2": 0.0, "points": 0, "queries": 0,
465
  "history": [], "game_over": False, "current_best_alt": None, "current_shuffled_alts": []
466
  })
467
 
@@ -469,7 +474,8 @@ with gr.Blocks(css=custom_css, title="EcoQueryQuest") as demo:
469
  gr.Markdown("<div class='subtitle'>Select a model, type a query, and watch Drip react. Reach 500 points to win!</div>")
470
 
471
  # 2. Stats initialized with 10.0L
472
- stats_html = gr.HTML(get_stats_html(10.0, 0.0, 0.0, 0))
 
473
 
474
  with gr.Column(visible=True) as main_game_ui:
475
  with gr.Row():
 
352
  feedback_text = f"<div class='feedback-box'>🧠 <strong>{category.upper()}</strong> Detected!<br><br><em>\"{dialogue}\"</em></div>"
353
 
354
  # WIN CONDITION
355
+ #if state["points"] >= 500:
356
+ if state["points"] >= 100: # Lowered for quick live demo
357
  state["game_over"] = True
358
  return (state, stats_ui, drip_ui, audio_path, impact_ui, gr.update(), gr.update(visible=False),
359
  gr.update(), gr.update(), gr.update(), gr.update(), gr.update(value=""),
 
461
 
462
  with gr.Blocks(css=custom_css, title="EcoQueryQuest") as demo:
463
  # 1. State initialized with 10.0L
464
+ #game_state = gr.State({
465
+ #"water": 10.0, "energy": 0.0, "co2": 0.0, "points": 0, "queries": 0,
466
+ #"history": [], "game_over": False, "current_best_alt": None, "current_shuffled_alts": []
467
+ #})
468
  game_state = gr.State({
469
+ "water": 2.0, "energy": 0.0, "co2": 0.0, "points": 0, "queries": 0, # Changed to 2.0L
470
  "history": [], "game_over": False, "current_best_alt": None, "current_shuffled_alts": []
471
  })
472
 
 
474
  gr.Markdown("<div class='subtitle'>Select a model, type a query, and watch Drip react. Reach 500 points to win!</div>")
475
 
476
  # 2. Stats initialized with 10.0L
477
+ #stats_html = gr.HTML(get_stats_html(10.0, 0.0, 0.0, 0))
478
+ stats_html = gr.HTML(get_stats_html(2.0, 0.0, 0.0, 0)) # Changed to 2.0L
479
 
480
  with gr.Column(visible=True) as main_game_ui:
481
  with gr.Row():