cgeorgiaw HF Staff commited on
Commit
1e4ed96
·
1 Parent(s): 20a6e65

still trying to make the leaderboard

Browse files
Files changed (1) hide show
  1. app.py +10 -1
app.py CHANGED
@@ -106,6 +106,10 @@ def write_results(record, result):
106
  pathlib.Path(tmp_name).unlink()
107
  return
108
 
 
 
 
 
109
 
110
  def get_leaderboard(problem_type: str):
111
  ds = load_dataset(results_repo, split='train')
@@ -133,7 +137,7 @@ def gradio_interface() -> gr.Blocks:
133
  value=leaderboard_df,
134
  select_columns=["submission_time", "feasibility", "score", "objective"],
135
  search_columns=["submission_time", "score"],
136
- hide_columns=["result_filename", "submission_filename", "minimize_objective", "boundary_json"],
137
  # filter_columns=["T", "Precision", "Model Size"],
138
  )
139
  with gr.TabItem("Submit", elem_id="boundary-benchmark-tab-table"):
@@ -143,6 +147,11 @@ def gradio_interface() -> gr.Blocks:
143
  Upload your plasma boundary JSON and select the problem type to get your score.
144
  """
145
  )
 
 
 
 
 
146
  with gr.Row():
147
  problem_type = gr.Dropdown(
148
  PROBLEM_TYPES, label="Problem Type", value="geometrical"
 
106
  pathlib.Path(tmp_name).unlink()
107
  return
108
 
109
+ def get_user_profile(profile: gr.OAuthProfile | None) -> str:
110
+ if profile is None:
111
+ return "Please login to submit a boundary for evaluation."
112
+ return profile.name
113
 
114
  def get_leaderboard(problem_type: str):
115
  ds = load_dataset(results_repo, split='train')
 
137
  value=leaderboard_df,
138
  select_columns=["submission_time", "feasibility", "score", "objective"],
139
  search_columns=["submission_time", "score"],
140
+ hide_columns=["result_filename", "submission_filename", "minimize_objective", "boundary_json", "evaluated"],
141
  # filter_columns=["T", "Precision", "Model Size"],
142
  )
143
  with gr.TabItem("Submit", elem_id="boundary-benchmark-tab-table"):
 
147
  Upload your plasma boundary JSON and select the problem type to get your score.
148
  """
149
  )
150
+
151
+ gr.LoginButton()
152
+ m1 = gr.Markdown()
153
+ demo.load(get_user_profile, inputs=None, outputs=m1)
154
+
155
  with gr.Row():
156
  problem_type = gr.Dropdown(
157
  PROBLEM_TYPES, label="Problem Type", value="geometrical"