dtcxzyw commited on
Commit
9c971f7
Β·
unverified Β·
1 Parent(s): 6364eae
Files changed (1) hide show
  1. app.py +41 -41
app.py CHANGED
@@ -194,51 +194,51 @@ with demo:
194
  gr.HTML(TITLE)
195
  gr.Markdown(INTRODUCTION_TEXT + f"\nTotal issues: {total_issues}\n", elem_classes="markdown-text")
196
 
197
- with gr.Tab("πŸ… Leaderboard"):
198
- leaderboard = init_leaderboard(LEADERBOARD_DF[COLS])
199
- gr.ScatterPlot(
200
- timeline_df,
201
- x="time",
202
- y="model",
203
- color="method_name",
204
- x_label="Time",
205
- y_label="Model",
206
- title="Timeline",
207
- y_lim=(-model_cnt - 1, 4),
208
- tooltip=["bug_id", "method_name", "time", "bug_type"],
209
- )
210
- gr.Dataframe(fixed_by_cat_df)
211
- gr.Dataframe(fixed_by_comp_df)
212
- gr.Dataframe(unique_bugs_df)
213
 
214
- with gr.Tab("πŸ” Inspect"):
215
- fixed_bug_title_id_pairs = [(bug_id_to_title[bug_id], bug_id) for bug_id in sorted(fixed_bug_ids)]
216
- with gr.Row():
217
- inspect_issue = gr.Dropdown(fixed_bug_title_id_pairs, label="Inspct Issue", interactive=True)
218
- inspect_fix = gr.Dropdown(list(bug_ids_to_patches.keys()), label="Method(Model)", interactive=True)
219
- with gr.Row():
220
- golden_patch = gr.Code("", language="cpp", label="Golden Patch")
221
- method_patch = gr.Code("", language="cpp", label="APR Patch")
222
- inspect_issue.change(
223
- fn=lambda bug_id, method: (
224
- bug_id_to_patch.get(bug_id, f"Not Available (bug_id = {bug_id})"),
225
- bug_ids_to_patches.get(method, dict()).get(
226
- bug_id, f"Not Available (method = {method}, bug_id = {bug_id})"
227
- ),
228
- ),
229
- inputs=[inspect_issue, inspect_fix],
230
- outputs=[golden_patch, method_patch],
231
- )
232
- inspect_fix.change(
233
- fn=lambda bug_id, method: bug_ids_to_patches.get(method, dict()).get(
234
  bug_id, f"Not Available (method = {method}, bug_id = {bug_id})"
235
  ),
236
- inputs=[inspect_issue, inspect_fix],
237
- outputs=[method_patch],
238
- )
 
 
 
 
 
 
 
 
239
 
240
- with gr.Tab("πŸš€ Submission"):
241
- gr.Markdown(EVALUATION_QUEUE_TEXT, elem_classes="markdown-text")
242
 
243
  with gr.Accordion("πŸ“™ Citation", open=False):
244
  citation_button = gr.Textbox(
 
194
  gr.HTML(TITLE)
195
  gr.Markdown(INTRODUCTION_TEXT + f"\nTotal issues: {total_issues}\n", elem_classes="markdown-text")
196
 
197
+ # with gr.Tab("πŸ… Leaderboard"):
198
+ leaderboard = init_leaderboard(LEADERBOARD_DF[COLS])
199
+ gr.ScatterPlot(
200
+ timeline_df,
201
+ x="time",
202
+ y="model",
203
+ color="method_name",
204
+ x_label="Time",
205
+ y_label="Model",
206
+ title="Timeline",
207
+ y_lim=(-model_cnt - 1, 4),
208
+ tooltip=["bug_id", "method_name", "time", "bug_type"],
209
+ )
210
+ gr.Dataframe(fixed_by_cat_df)
211
+ gr.Dataframe(fixed_by_comp_df)
212
+ gr.Dataframe(unique_bugs_df)
213
 
214
+ # with gr.Tab("πŸ” Inspect"):
215
+ fixed_bug_title_id_pairs = [(bug_id_to_title[bug_id], bug_id) for bug_id in sorted(fixed_bug_ids)]
216
+ with gr.Row():
217
+ inspect_issue = gr.Dropdown(fixed_bug_title_id_pairs, label="Inspct Issue", interactive=True)
218
+ inspect_fix = gr.Dropdown(list(bug_ids_to_patches.keys()), label="Method(Model)", interactive=True)
219
+ with gr.Row():
220
+ golden_patch = gr.Code("", language="cpp", label="Golden Patch")
221
+ method_patch = gr.Code("", language="cpp", label="APR Patch")
222
+ inspect_issue.change(
223
+ fn=lambda bug_id, method: (
224
+ bug_id_to_patch.get(bug_id, f"Not Available (bug_id = {bug_id})"),
225
+ bug_ids_to_patches.get(method, dict()).get(
 
 
 
 
 
 
 
 
226
  bug_id, f"Not Available (method = {method}, bug_id = {bug_id})"
227
  ),
228
+ ),
229
+ inputs=[inspect_issue, inspect_fix],
230
+ outputs=[golden_patch, method_patch],
231
+ )
232
+ inspect_fix.change(
233
+ fn=lambda bug_id, method: bug_ids_to_patches.get(method, dict()).get(
234
+ bug_id, f"Not Available (method = {method}, bug_id = {bug_id})"
235
+ ),
236
+ inputs=[inspect_issue, inspect_fix],
237
+ outputs=[method_patch],
238
+ )
239
 
240
+ # with gr.Tab("πŸš€ Submission"):
241
+ gr.Markdown(EVALUATION_QUEUE_TEXT, elem_classes="markdown-text")
242
 
243
  with gr.Accordion("πŸ“™ Citation", open=False):
244
  citation_button = gr.Textbox(