Spaces:
Sleeping
Sleeping
chore: download full log and invisible gr.File
Browse files
app.py
CHANGED
|
@@ -120,6 +120,11 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
| 120 |
response = requests.post(submit_url, json=submission_data, timeout=60)
|
| 121 |
response.raise_for_status()
|
| 122 |
result_data = response.json()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 123 |
final_status = (
|
| 124 |
f"Submission Successful!\n"
|
| 125 |
f"User: {result_data.get('username')}\n"
|
|
@@ -129,9 +134,6 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
| 129 |
)
|
| 130 |
print("Submission successful.")
|
| 131 |
results_df = pd.DataFrame(results_log)
|
| 132 |
-
|
| 133 |
-
with open("results_log.json", "w") as results_session_file:
|
| 134 |
-
json.dump(results_log, results_session_file)
|
| 135 |
|
| 136 |
return final_status, results_df, gr.update(interactive=True)
|
| 137 |
|
|
@@ -192,7 +194,7 @@ with gr.Blocks() as demo:
|
|
| 192 |
outputs=[status_output, results_table, download_button]
|
| 193 |
)
|
| 194 |
|
| 195 |
-
file_output = gr.File(label="Download Log File")
|
| 196 |
|
| 197 |
download_button.click(
|
| 198 |
fn=download_log,
|
|
|
|
| 120 |
response = requests.post(submit_url, json=submission_data, timeout=60)
|
| 121 |
response.raise_for_status()
|
| 122 |
result_data = response.json()
|
| 123 |
+
results_log.update({'result_data': result_data})
|
| 124 |
+
|
| 125 |
+
with open("results_log.json", "w") as results_session_file:
|
| 126 |
+
json.dump(results_log, results_session_file)
|
| 127 |
+
|
| 128 |
final_status = (
|
| 129 |
f"Submission Successful!\n"
|
| 130 |
f"User: {result_data.get('username')}\n"
|
|
|
|
| 134 |
)
|
| 135 |
print("Submission successful.")
|
| 136 |
results_df = pd.DataFrame(results_log)
|
|
|
|
|
|
|
|
|
|
| 137 |
|
| 138 |
return final_status, results_df, gr.update(interactive=True)
|
| 139 |
|
|
|
|
| 194 |
outputs=[status_output, results_table, download_button]
|
| 195 |
)
|
| 196 |
|
| 197 |
+
file_output = gr.File(label="Download Log File", visible=False))
|
| 198 |
|
| 199 |
download_button.click(
|
| 200 |
fn=download_log,
|