Spaces:
Sleeping
Sleeping
fix: add file_output and toogle bttn
Browse files
app.py
CHANGED
|
@@ -143,7 +143,7 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
| 143 |
status_message = f"An unexpected error occurred during submission: {e}"
|
| 144 |
print(status_message)
|
| 145 |
results_df = pd.DataFrame(results_log)
|
| 146 |
-
return status_message, results_df
|
| 147 |
|
| 148 |
|
| 149 |
def download_log():
|
|
@@ -157,6 +157,8 @@ with gr.Blocks() as demo:
|
|
| 157 |
gr.LoginButton()
|
| 158 |
|
| 159 |
run_button = gr.Button("Run Evaluation & Submit All Answers")
|
|
|
|
|
|
|
| 160 |
|
| 161 |
status_output = gr.Textbox(label="Run Status / Submission Result", lines=5, interactive=False)
|
| 162 |
|
|
@@ -164,9 +166,11 @@ with gr.Blocks() as demo:
|
|
| 164 |
|
| 165 |
run_button.click(
|
| 166 |
fn=run_and_submit_all,
|
| 167 |
-
outputs=[status_output, results_table]
|
| 168 |
)
|
| 169 |
-
|
|
|
|
|
|
|
| 170 |
download_button.click(
|
| 171 |
fn=download_log,
|
| 172 |
outputs=file_output
|
|
|
|
| 143 |
status_message = f"An unexpected error occurred during submission: {e}"
|
| 144 |
print(status_message)
|
| 145 |
results_df = pd.DataFrame(results_log)
|
| 146 |
+
return status_message, results_df, gr.update(interactive=True)
|
| 147 |
|
| 148 |
|
| 149 |
def download_log():
|
|
|
|
| 157 |
gr.LoginButton()
|
| 158 |
|
| 159 |
run_button = gr.Button("Run Evaluation & Submit All Answers")
|
| 160 |
+
|
| 161 |
+
download_button = gr.Button("Download Evaluation Log", interactive=False))
|
| 162 |
|
| 163 |
status_output = gr.Textbox(label="Run Status / Submission Result", lines=5, interactive=False)
|
| 164 |
|
|
|
|
| 166 |
|
| 167 |
run_button.click(
|
| 168 |
fn=run_and_submit_all,
|
| 169 |
+
outputs=[status_output, results_table, download_button]
|
| 170 |
)
|
| 171 |
+
|
| 172 |
+
file_output = gr.File(label="Download Log File")
|
| 173 |
+
|
| 174 |
download_button.click(
|
| 175 |
fn=download_log,
|
| 176 |
outputs=file_output
|