dtcxzyw commited on
Commit
62f66d3
·
unverified ·
1 Parent(s): ecb4345
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -211,7 +211,11 @@ with demo:
211
  inspect_issue = gr.Dropdown(fixed_bug_title_id_pairs, label="Inspct Issue", interactive=True)
212
  golden_patch = gr.Code("", language="cpp", label="Golden Patch")
213
  inspect_issue.change(
214
- fn=lambda bug_id: dataset["test"][bug_id]["patch"] if bug_id in dataset["test"] else "Not Available",
 
 
 
 
215
  inputs=inspect_issue,
216
  outputs=golden_patch,
217
  )
 
211
  inspect_issue = gr.Dropdown(fixed_bug_title_id_pairs, label="Inspct Issue", interactive=True)
212
  golden_patch = gr.Code("", language="cpp", label="Golden Patch")
213
  inspect_issue.change(
214
+ fn=lambda bug_id: (
215
+ dataset["test"][bug_id]["patch"]
216
+ if bug_id in dataset["test"]
217
+ else f"Not Available (bug_id = {bug_id})"
218
+ ),
219
  inputs=inspect_issue,
220
  outputs=golden_patch,
221
  )