dtcxzyw commited on
Commit
55fbf88
Β·
unverified Β·
1 Parent(s): 9c971f7
Files changed (1) hide show
  1. app.py +23 -21
app.py CHANGED
@@ -212,30 +212,32 @@ with demo:
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")
 
212
  gr.Dataframe(unique_bugs_df)
213
 
214
  # with gr.Tab("πŸ” Inspect"):
 
215
  with gr.Row():
216
+ fixed_bug_title_id_pairs = [(bug_id_to_title[bug_id], bug_id) for bug_id in sorted(fixed_bug_ids)]
217
+ with gr.Column():
218
+ inspect_issue = gr.Dropdown(fixed_bug_title_id_pairs, label="Inspct Issue", interactive=True)
219
+ golden_patch = gr.Code("", language="cpp", label="Golden Patch")
220
+
221
+ with gr.Column():
222
+ inspect_fix = gr.Dropdown(list(bug_ids_to_patches.keys()), label="Method(Model)", interactive=True)
223
+ method_patch = gr.Code("", language="cpp", label="APR Patch")
224
+ inspect_issue.change(
225
+ fn=lambda bug_id, method: (
226
+ bug_id_to_patch.get(bug_id, f"Not Available (bug_id = {bug_id})"),
227
+ bug_ids_to_patches.get(method, dict()).get(
228
+ bug_id, f"Not Available (method = {method}, bug_id = {bug_id})"
229
+ ),
230
+ ),
231
+ inputs=[inspect_issue, inspect_fix],
232
+ outputs=[golden_patch, method_patch],
233
+ )
234
+ inspect_fix.change(
235
+ fn=lambda bug_id, method: bug_ids_to_patches.get(method, dict()).get(
236
  bug_id, f"Not Available (method = {method}, bug_id = {bug_id})"
237
  ),
238
+ inputs=[inspect_issue, inspect_fix],
239
+ outputs=[method_patch],
240
+ )
 
 
 
 
 
 
 
 
241
 
242
  # with gr.Tab("πŸš€ Submission"):
243
  gr.Markdown(EVALUATION_QUEUE_TEXT, elem_classes="markdown-text")