root commited on
Commit
28a5503
·
1 Parent(s): 929e531

update app

Browse files
Files changed (1) hide show
  1. app.py +10 -6
app.py CHANGED
@@ -431,6 +431,8 @@ def get_example_input():
431
  problem = problems[task_id]
432
  prefix, suffix = problem['prompt'], problem['suffix']
433
  test_case = problem['test']
 
 
434
  return prefix, '', suffix, test_case, task_id, ''
435
 
436
  def check_result(task_id, completion):
@@ -458,6 +460,14 @@ def create_chatbot_demo():
458
  "[[Blog](https://hkunlp.github.io/blog/2025/dreamon/)]"
459
  )
460
 
 
 
 
 
 
 
 
 
461
  with gr.Row():
462
  with gr.Column():
463
  # Prefix input
@@ -502,13 +512,7 @@ def create_chatbot_demo():
502
  lines=2
503
  )
504
 
505
- with gr.Row():
506
- sample_btn = gr.Button("Example Prompt")
507
 
508
- with gr.Row():
509
- generate_btn = gr.Button("Generate", variant="primary")
510
- clear_btn = gr.Button("Clear")
511
- check_btn = gr.Button("Run test case")
512
 
513
  # Generation Settings
514
  with gr.Accordion("Generation Settings"):
 
431
  problem = problems[task_id]
432
  prefix, suffix = problem['prompt'], problem['suffix']
433
  test_case = problem['test']
434
+ test_case = test_case.replace('def check(candidate):', 'def run_test():')
435
+ test_case = test_case.replace('candidate', test_case['entry_point'])
436
  return prefix, '', suffix, test_case, task_id, ''
437
 
438
  def check_result(task_id, completion):
 
460
  "[[Blog](https://hkunlp.github.io/blog/2025/dreamon/)]"
461
  )
462
 
463
+ with gr.Row():
464
+ sample_btn = gr.Button("Example Prompt")
465
+
466
+ with gr.Row():
467
+ generate_btn = gr.Button("Generate", variant="primary")
468
+ clear_btn = gr.Button("Clear")
469
+ check_btn = gr.Button("Run test case")
470
+
471
  with gr.Row():
472
  with gr.Column():
473
  # Prefix input
 
512
  lines=2
513
  )
514
 
 
 
515
 
 
 
 
 
516
 
517
  # Generation Settings
518
  with gr.Accordion("Generation Settings"):