Joffrey Thomas commited on
Commit
7d93d9d
·
1 Parent(s): 743500d

fix next round

Browse files
Files changed (1) hide show
  1. app.py +2 -9
app.py CHANGED
@@ -856,21 +856,14 @@ with gr.Blocks(css=APP_CSS, title="LLM GeoGuessr") as demo:
856
  </div>
857
  </div>
858
  """
859
- popup_html = popup_html.replace('__SCOREBOARD__', scoreboard_html) \
860
- .replace('__RND_LAT__', str(rnd['lat'])) \
861
- .replace('__RND_LNG__', str(rnd['lng'])) \
862
- .replace('__H_LAT__', str(float(lat))) \
863
- .replace('__H_LNG__', str(float(lng))) \
864
- .replace('__AI_LAT__', ai_lat_str) \
865
- .replace('__AI_LNG__', ai_lng_str) \
866
- .replace('__GMAPS_KEY__', GOOGLE_MAPS_API_KEY or '')
867
 
868
  yield popup_html, (txt + ("\n\n" + (last_text or "")))
869
 
870
  validate_btn.click(on_validate, inputs=[round_id_box, lat_box, lng_box, user_profile], outputs=[popup_html, ai_chat])
871
 
872
  def on_next(r_state: list, idx: int, profile: dict, request: gr.Request):
873
- if not profile: return
874
  username = profile["name"]
875
  idx += 1
876
  sess = user_sessions.get(username)
 
856
  </div>
857
  </div>
858
  """
859
+ popup_html = popup_html.replace('__SCOREBOARD__', scoreboard_html) .replace('__RND_LAT__', str(rnd['lat'])) .replace('__RND_LNG__', str(rnd['lng'])) .replace('__H_LAT__', str(float(lat))) .replace('__H_LNG__', str(float(lng))) .replace('__AI_LAT__', ai_lat_str) .replace('__AI_LNG__', ai_lng_str) .replace('__GMAPS_KEY__', GOOGLE_MAPS_API_KEY or '')
 
 
 
 
 
 
 
860
 
861
  yield popup_html, (txt + ("\n\n" + (last_text or "")))
862
 
863
  validate_btn.click(on_validate, inputs=[round_id_box, lat_box, lng_box, user_profile], outputs=[popup_html, ai_chat])
864
 
865
  def on_next(r_state: list, idx: int, profile: dict, request: gr.Request):
866
+ if not profile: return idx, gr.update(), gr.update(), gr.update()
867
  username = profile["name"]
868
  idx += 1
869
  sess = user_sessions.get(username)