Spaces:
Runtime error
Runtime error
Terry Zhuo commited on
Commit ·
b64230f
1
Parent(s): 3980eb8
update
Browse filesFiles changed (2)
- README.md+1
- src/execute.py+1-65
3 unmodified lines456789103 unmodified linescolorFrom: greencolorTo: indigosdk: dockerdisable_embedding: truepinned: falselicense: apache-2.0tags:110 unmodified lines111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178114110 unmodified lines log_content = [] for log_line in run_bigcodebench(command): log_content.append(log_line) yield "".join(log_content) with gr.Blocks() as demo: gr.Markdown("# BigCodeBench Evaluator") with gr.Row(): jsonl_file = gr.File(label="Upload JSONL file", file_types=[".jsonl"]) split = gr.Dropdown(choices=["complete", "instruct"], label="Split", value="complete") subset = gr.Dropdown(choices=["hard"], label="Subset", value="hard") with gr.Row(): parallel = gr.Number(label="Parallel (optional)", precision=0) min_time_limit = gr.Number(label="Min Time Limit", value=1, precision=1) max_as_limit = gr.Number(label="Max AS Limit", value=25*1024, precision=0) with gr.Row(): max_data_limit = gr.Number(label="Max Data Limit", value=25*1024, precision=0) max_stack_limit = gr.Number(label="Max Stack Limit", value=10, precision=0) check_gt_only = gr.Checkbox(label="Check GT Only") no_gt = gr.Checkbox(label="No GT") command_output = gr.Textbox(label="Command", value=default_command, interactive=False) with gr.Row(): submit_btn = gr.Button("Run Evaluation") download_btn = gr.DownloadButton(label="Download Result") log_output = gr.Textbox(label="Execution Logs", lines=20) input_components = [ jsonl_file, split, subset, parallel, min_time_limit, max_as_limit, max_data_limit, max_stack_limit, check_gt_only, no_gt ] for component in input_components: component.change(generate_command, inputs=input_components, outputs=command_output) def start_evaluation(command, jsonl_file, subset, split): extra = subset + "_" if subset != "full" else "" if jsonl_file is not None: result_path = os.path.basename(jsonl_file.name).replace(".jsonl", f"_{extra}eval_results.json") else: result_path = None
for log in stream_logs(command, jsonl_file): if jsonl_file is not None: yield log, gr.update(value=result_path, label=result_path), gr.update() else: yield log, gr.update(), gr.update() is_running = False result_file = find_result_file() if result_file: return gr.update(label="Evaluation completed. Result file found."), gr.update(value=result_file) # gr.Button(visible=False)#, # gr.DownloadButton(label="Download Result", value=result_file, visible=True)) else: return gr.update(label="Evaluation completed. No result file found."), gr.update(value=result_path) # gr.Button("Run Evaluation", visible=True), # gr.DownloadButton(visible=False)) submit_btn.click(start_evaluation, inputs=[command_output, jsonl_file, subset, split], outputs=[log_output, download_btn])
demo.queue(max_size=300).launch(share=True, server_name="0.0.0.0", server_port=7860)scheduler = BackgroundScheduler() yield "".join(log_content)README.md+1
src/execute.py+1-65