forouzanfallah commited on
Commit
ef5c435
·
1 Parent(s): c8947b5

RTS Human Evaluation

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -836,15 +836,16 @@ def hide_thanks():
836
  """Hide the thank-you screen (used when starting/resuming)."""
837
  return gr.update(visible=False)
838
 
839
- def maybe_show_thanks(name: str, samples: List[Sample], seen: List[str]):
840
  # If the user has finished all assigned images, hide eval and show Thanks.
841
  done = len(set(seen or [])) >= TARGET_PER_PERSON
842
  if done:
843
- return to_thanks(name) # (eval_panel_update, thanks_group_update, thanks_md_update)
844
  # leave UI as-is
845
  return gr.update(), gr.update(visible=False), gr.update()
846
 
847
 
 
848
  # ----------------------
849
  # UI
850
  # ----------------------
@@ -1077,9 +1078,9 @@ with gr.Blocks(title="RTS Human Evaluation", theme=gr.themes.Soft()) as demo:
1077
  outputs=[step_status, group_detection, group_confidence, group_tiles, group_clarity, group_reasoning, back_btn, next_btn],
1078
  )
1079
  nextimg_event.then(
1080
- maybe_show_thanks,
1081
- inputs=[name, state_seen],
1082
- outputs=[step_status, group_detection, group_confidence, group_tiles, group_clarity, group_reasoning, back_btn, next_btn],
1083
  )
1084
 
1085
  ## Restart: start again using current name/email
 
836
  """Hide the thank-you screen (used when starting/resuming)."""
837
  return gr.update(visible=False)
838
 
839
+ def maybe_show_thanks(name: str, seen: List[str]):
840
  # If the user has finished all assigned images, hide eval and show Thanks.
841
  done = len(set(seen or [])) >= TARGET_PER_PERSON
842
  if done:
843
+ return to_thanks(name) # returns (eval_panel_update, thanks_group_update, thanks_md_update)
844
  # leave UI as-is
845
  return gr.update(), gr.update(visible=False), gr.update()
846
 
847
 
848
+
849
  # ----------------------
850
  # UI
851
  # ----------------------
 
1078
  outputs=[step_status, group_detection, group_confidence, group_tiles, group_clarity, group_reasoning, back_btn, next_btn],
1079
  )
1080
  nextimg_event.then(
1081
+ maybe_show_thanks,
1082
+ inputs=[name, state_seen],
1083
+ outputs=[eval_panel, thanks_group, thanks_md],
1084
  )
1085
 
1086
  ## Restart: start again using current name/email