Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -79,49 +79,52 @@ def read_logs():
|
|
79 |
with open(log_file, "r") as f:
|
80 |
return f.read()
|
81 |
|
82 |
-
|
83 |
-
gr.
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
component
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
|
|
125 |
|
|
|
|
|
126 |
if __name__ == "__main__":
|
127 |
-
|
|
|
79 |
with open(log_file, "r") as f:
|
80 |
return f.read()
|
81 |
|
82 |
+
def run()
|
83 |
+
with gr.Blocks() as demo:
|
84 |
+
gr.Markdown("# BigCodeBench Evaluation App")
|
85 |
+
|
86 |
+
with gr.Row():
|
87 |
+
jsonl_file = gr.File(label="Upload JSONL file", file_types=[".jsonl"])
|
88 |
+
split = gr.Dropdown(choices=["complete", "instruct"], label="Split", value="complete")
|
89 |
+
subset = gr.Dropdown(choices=["full", "hard"], label="Subset", value="full")
|
90 |
+
|
91 |
+
with gr.Row():
|
92 |
+
save_pass_rate = gr.Checkbox(label="Save Pass Rate")
|
93 |
+
parallel = gr.Number(label="Parallel (optional)", precision=0)
|
94 |
+
min_time_limit = gr.Number(label="Min Time Limit", value=1, precision=1)
|
95 |
+
max_as_limit = gr.Number(label="Max AS Limit", value=128*1024, precision=0)
|
96 |
+
|
97 |
+
with gr.Row():
|
98 |
+
max_data_limit = gr.Number(label="Max Data Limit", value=4*1024, precision=0)
|
99 |
+
max_stack_limit = gr.Number(label="Max Stack Limit", value=5, precision=0)
|
100 |
+
check_gt_only = gr.Checkbox(label="Check GT Only")
|
101 |
+
no_gt = gr.Checkbox(label="No GT")
|
102 |
+
|
103 |
+
command_output = gr.Textbox(label="Command", lines=2)
|
104 |
+
submit_btn = gr.Button("Run Evaluation")
|
105 |
+
log_output = gr.Textbox(label="Execution Logs", lines=10)
|
106 |
+
|
107 |
+
def update_command(*args):
|
108 |
+
return generate_command(*args)
|
109 |
+
|
110 |
+
input_components = [
|
111 |
+
jsonl_file, split, subset, save_pass_rate, parallel,
|
112 |
+
min_time_limit, max_as_limit, max_data_limit, max_stack_limit,
|
113 |
+
check_gt_only, no_gt
|
114 |
+
]
|
115 |
+
|
116 |
+
for component in input_components:
|
117 |
+
component.change(update_command, inputs=input_components, outputs=command_output)
|
118 |
+
|
119 |
+
def on_submit(command):
|
120 |
+
threading.Thread(target=run_bigcodebench, args=(command,), daemon=True).start()
|
121 |
+
return "Evaluation started. Please wait for the logs to update..."
|
122 |
+
|
123 |
+
submit_btn.click(on_submit, inputs=[command_output], outputs=[log_output])
|
124 |
+
|
125 |
+
demo.load(read_logs, None, log_output, every=1)
|
126 |
|
127 |
+
demo.queue().launch()
|
128 |
+
|
129 |
if __name__ == "__main__":
|
130 |
+
run()
|