Terry Zhuo
commited on
Commit
·
1bb4e03
1
Parent(s):
d693904
update global flg
Browse files
app.py
CHANGED
@@ -48,7 +48,7 @@ from src.envs import (
|
|
48 |
HF_HOME,
|
49 |
)
|
50 |
from src.populate import get_evaluation_queue_df, get_leaderboard_df
|
51 |
-
from src.execute import generate_command,
|
52 |
from src.tools.plots import plot_elo_mle, plot_solve_rate
|
53 |
# from src.voting.vote_system import VoteManager, run_scheduler
|
54 |
|
@@ -543,7 +543,7 @@ with main_block as demo:
|
|
543 |
command_output = gr.Textbox(label="Command", value=default_command, interactive=False)
|
544 |
with gr.Row():
|
545 |
submit_btn = gr.Button("Run Evaluation")
|
546 |
-
download_btn = gr.DownloadButton(label="Download Result")
|
547 |
log_output = gr.Textbox(label="Execution Logs", lines=20)
|
548 |
|
549 |
input_components = [
|
@@ -564,8 +564,8 @@ with main_block as demo:
|
|
564 |
result_path = None
|
565 |
|
566 |
for log in stream_logs(command, jsonl_file):
|
567 |
-
if jsonl_file is not None:
|
568 |
-
yield log, gr.update(value=result_path, label=result_path), gr.update()
|
569 |
else:
|
570 |
yield log, gr.update(), gr.update()
|
571 |
result_file = find_result_file()
|
@@ -579,7 +579,7 @@ with main_block as demo:
|
|
579 |
# gr.DownloadButton(visible=False))
|
580 |
submit_btn.click(start_evaluation,
|
581 |
inputs=[command_output, jsonl_file, subset, split],
|
582 |
-
outputs=[log_output, download_btn])
|
583 |
|
584 |
with gr.TabItem("🚀 Request", id=4):
|
585 |
gr.Markdown(SUBMISSION_TEXT_3)
|
|
|
48 |
HF_HOME,
|
49 |
)
|
50 |
from src.populate import get_evaluation_queue_df, get_leaderboard_df
|
51 |
+
from src.execute import generate_command, default_command, stream_logs, find_result_file
|
52 |
from src.tools.plots import plot_elo_mle, plot_solve_rate
|
53 |
# from src.voting.vote_system import VoteManager, run_scheduler
|
54 |
|
|
|
543 |
command_output = gr.Textbox(label="Command", value=default_command, interactive=False)
|
544 |
with gr.Row():
|
545 |
submit_btn = gr.Button("Run Evaluation")
|
546 |
+
download_btn = gr.DownloadButton(label="Download Result", visible=False)
|
547 |
log_output = gr.Textbox(label="Execution Logs", lines=20)
|
548 |
|
549 |
input_components = [
|
|
|
564 |
result_path = None
|
565 |
|
566 |
for log in stream_logs(command, jsonl_file):
|
567 |
+
if jsonl_file is not None and jsonl_file.name.endswith(".jsonl"):
|
568 |
+
yield log, gr.update(value=result_path, label=result_path, visible=True), gr.update(visible=False)
|
569 |
else:
|
570 |
yield log, gr.update(), gr.update()
|
571 |
result_file = find_result_file()
|
|
|
579 |
# gr.DownloadButton(visible=False))
|
580 |
submit_btn.click(start_evaluation,
|
581 |
inputs=[command_output, jsonl_file, subset, split],
|
582 |
+
outputs=[log_output, download_btn, submit_btn])
|
583 |
|
584 |
with gr.TabItem("🚀 Request", id=4):
|
585 |
gr.Markdown(SUBMISSION_TEXT_3)
|