Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Clémentine
commited on
Commit
·
aaaafe3
1
Parent(s):
8c14d95
add log to debug
Browse files- yourbench_space/app.py +5 -2
yourbench_space/app.py
CHANGED
|
@@ -137,6 +137,7 @@ def init_session():
|
|
| 137 |
"""Update session on load"""
|
| 138 |
local_uuid = str(uuid.uuid4())
|
| 139 |
MANAGERS.create(local_uuid)
|
|
|
|
| 140 |
return gr.State(local_uuid, delete_callback=lambda uid: MANAGERS.remove(uid))
|
| 141 |
|
| 142 |
|
|
@@ -144,7 +145,6 @@ with gr.Blocks(theme=gr.themes.Default()) as app:
|
|
| 144 |
# We initialize the session state with the user randomly generated uuid
|
| 145 |
# Using uuid4 makes collision cases extremely unlikely even for concurrent users
|
| 146 |
session_state = gr.State()
|
| 147 |
-
app.load(init_session, outputs=session_state)
|
| 148 |
|
| 149 |
gr.Markdown(project_description)
|
| 150 |
|
|
@@ -216,7 +216,7 @@ with gr.Blocks(theme=gr.themes.Default()) as app:
|
|
| 216 |
log_output = gr.Code(language=None, lines=20, interactive=False)
|
| 217 |
|
| 218 |
process_status = gr.Checkbox(label="Process Status", interactive=False)
|
| 219 |
-
status_timer = gr.Timer(
|
| 220 |
status_timer.tick(update_process_status, inputs=session_state, outputs=process_status)
|
| 221 |
|
| 222 |
with gr.Column():
|
|
@@ -244,6 +244,7 @@ with gr.Blocks(theme=gr.themes.Default()) as app:
|
|
| 244 |
update_dataset, inputs=[stages_table, hf_org_dropdown, hf_dataset_name], outputs=[ingestion_df, summarization_df, single_hop, answers_df]
|
| 245 |
)
|
| 246 |
|
|
|
|
| 247 |
log_timer = gr.Timer(1.0, active=True)
|
| 248 |
log_timer.tick(
|
| 249 |
MANAGERS.read_and_get_output, inputs=session_state, outputs=[log_output, stages_table]
|
|
@@ -255,5 +256,7 @@ with gr.Blocks(theme=gr.themes.Default()) as app:
|
|
| 255 |
|
| 256 |
btn_launch_evals.click(run_evaluation_pipeline, [hf_org_dropdown, hf_dataset_name], status)
|
| 257 |
|
|
|
|
|
|
|
| 258 |
|
| 259 |
app.launch(allowed_paths=["/app"])
|
|
|
|
| 137 |
"""Update session on load"""
|
| 138 |
local_uuid = str(uuid.uuid4())
|
| 139 |
MANAGERS.create(local_uuid)
|
| 140 |
+
logger.info(f"Started session for {local_uuid}")
|
| 141 |
return gr.State(local_uuid, delete_callback=lambda uid: MANAGERS.remove(uid))
|
| 142 |
|
| 143 |
|
|
|
|
| 145 |
# We initialize the session state with the user randomly generated uuid
|
| 146 |
# Using uuid4 makes collision cases extremely unlikely even for concurrent users
|
| 147 |
session_state = gr.State()
|
|
|
|
| 148 |
|
| 149 |
gr.Markdown(project_description)
|
| 150 |
|
|
|
|
| 216 |
log_output = gr.Code(language=None, lines=20, interactive=False)
|
| 217 |
|
| 218 |
process_status = gr.Checkbox(label="Process Status", interactive=False)
|
| 219 |
+
status_timer = gr.Timer(2.0, active=True)
|
| 220 |
status_timer.tick(update_process_status, inputs=session_state, outputs=process_status)
|
| 221 |
|
| 222 |
with gr.Column():
|
|
|
|
| 244 |
update_dataset, inputs=[stages_table, hf_org_dropdown, hf_dataset_name], outputs=[ingestion_df, summarization_df, single_hop, answers_df]
|
| 245 |
)
|
| 246 |
|
| 247 |
+
# TODO: this timer should only be active when the second tab is passed to active for the first time
|
| 248 |
log_timer = gr.Timer(1.0, active=True)
|
| 249 |
log_timer.tick(
|
| 250 |
MANAGERS.read_and_get_output, inputs=session_state, outputs=[log_output, stages_table]
|
|
|
|
| 256 |
|
| 257 |
btn_launch_evals.click(run_evaluation_pipeline, [hf_org_dropdown, hf_dataset_name], status)
|
| 258 |
|
| 259 |
+
app.load(init_session, outputs=session_state)
|
| 260 |
+
|
| 261 |
|
| 262 |
app.launch(allowed_paths=["/app"])
|