Spaces:
Sleeping
Sleeping
Pointf5ive commited on
Commit Β·
c4147bf
1
Parent(s): df7d6cf
Fix Smoke Signal hang: remove wizard.load, disable SSR
Browse files- app.py +1 -1
- smoke_signal_tab.py +9 -2
app.py
CHANGED
|
@@ -1389,4 +1389,4 @@ with gr.Blocks(title="TOTEM Studio", css=CSS + SS_CSS, head=HEAD) as demo:
|
|
| 1389 |
|
| 1390 |
|
| 1391 |
if __name__ == "__main__":
|
| 1392 |
-
demo.launch()
|
|
|
|
| 1389 |
|
| 1390 |
|
| 1391 |
if __name__ == "__main__":
|
| 1392 |
+
demo.launch(ssr_mode=False)
|
smoke_signal_tab.py
CHANGED
|
@@ -1141,6 +1141,8 @@ def smoke_signal_tab():
|
|
| 1141 |
wrap=True,
|
| 1142 |
)
|
| 1143 |
ingest_log = gr.Textbox(label="Log", lines=6, interactive=False, elem_classes=["ss-log"])
|
|
|
|
|
|
|
| 1144 |
|
| 1145 |
ingest_btn.click(
|
| 1146 |
ingest_pdfs,
|
|
@@ -1148,7 +1150,7 @@ def smoke_signal_tab():
|
|
| 1148 |
outputs=[ingest_status, manifest_table, ingest_log],
|
| 1149 |
)
|
| 1150 |
gr.HTML('<div style="height:16px"></div>')
|
| 1151 |
-
|
| 1152 |
|
| 1153 |
# ββ STEP 2: PROFILE βββββββββββββββββββββββββββββββββββββββββββββββ
|
| 1154 |
with gr.TabItem("β‘ Profile", id="ss-profile"):
|
|
@@ -1237,6 +1239,7 @@ def smoke_signal_tab():
|
|
| 1237 |
quar_btn = gr.Button("β Quarantine", elem_classes=["ss-btn-quar"])
|
| 1238 |
next_btn = gr.Button("Next Item β", elem_classes=["ss-btn-next"])
|
| 1239 |
|
|
|
|
| 1240 |
current_idx = gr.State(0)
|
| 1241 |
|
| 1242 |
review_outputs = [training_feedback, review_image, raw_text_box, item_info,
|
|
@@ -1277,6 +1280,10 @@ def smoke_signal_tab():
|
|
| 1277 |
action_outputs = [training_feedback, review_status, current_idx,
|
| 1278 |
review_image, raw_text_box, final_text_box, item_info]
|
| 1279 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1280 |
accept_btn.click(do_accept, inputs=[current_idx, final_text_box, reviewer_name, reason_code], outputs=action_outputs)
|
| 1281 |
edit_btn.click(do_accept, inputs=[current_idx, final_text_box, reviewer_name, reason_code], outputs=action_outputs)
|
| 1282 |
reject_btn.click(do_reject, inputs=[current_idx, final_text_box, reviewer_name, reason_code], outputs=action_outputs)
|
|
@@ -1290,7 +1297,7 @@ def smoke_signal_tab():
|
|
| 1290 |
next_btn.click(_next, inputs=[current_idx],
|
| 1291 |
outputs=[current_idx, review_image, raw_text_box, final_text_box, item_info])
|
| 1292 |
|
| 1293 |
-
|
| 1294 |
|
| 1295 |
# ββ STEP 5: EXPORT ββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 1296 |
with gr.TabItem("β€ Export", id="ss-export"):
|
|
|
|
| 1141 |
wrap=True,
|
| 1142 |
)
|
| 1143 |
ingest_log = gr.Textbox(label="Log", lines=6, interactive=False, elem_classes=["ss-log"])
|
| 1144 |
+
refresh_btn = gr.Button("β» Refresh Manifest", size="sm")
|
| 1145 |
+
refresh_btn.click(lambda: load_manifest_df(), outputs=[manifest_table])
|
| 1146 |
|
| 1147 |
ingest_btn.click(
|
| 1148 |
ingest_pdfs,
|
|
|
|
| 1150 |
outputs=[ingest_status, manifest_table, ingest_log],
|
| 1151 |
)
|
| 1152 |
gr.HTML('<div style="height:16px"></div>')
|
| 1153 |
+
# Auto-load removed β use Refresh button instead to avoid SSR hang
|
| 1154 |
|
| 1155 |
# ββ STEP 2: PROFILE βββββββββββββββββββββββββββββββββββββββββββββββ
|
| 1156 |
with gr.TabItem("β‘ Profile", id="ss-profile"):
|
|
|
|
| 1239 |
quar_btn = gr.Button("β Quarantine", elem_classes=["ss-btn-quar"])
|
| 1240 |
next_btn = gr.Button("Next Item β", elem_classes=["ss-btn-next"])
|
| 1241 |
|
| 1242 |
+
load_review_btn = gr.Button("β» Load Review Queue", elem_classes=["ss-btn-next"])
|
| 1243 |
current_idx = gr.State(0)
|
| 1244 |
|
| 1245 |
review_outputs = [training_feedback, review_image, raw_text_box, item_info,
|
|
|
|
| 1280 |
action_outputs = [training_feedback, review_status, current_idx,
|
| 1281 |
review_image, raw_text_box, final_text_box, item_info]
|
| 1282 |
|
| 1283 |
+
load_review_btn.click(
|
| 1284 |
+
load_review,
|
| 1285 |
+
outputs=[review_status, review_image, raw_text_box, final_text_box, item_info]
|
| 1286 |
+
)
|
| 1287 |
accept_btn.click(do_accept, inputs=[current_idx, final_text_box, reviewer_name, reason_code], outputs=action_outputs)
|
| 1288 |
edit_btn.click(do_accept, inputs=[current_idx, final_text_box, reviewer_name, reason_code], outputs=action_outputs)
|
| 1289 |
reject_btn.click(do_reject, inputs=[current_idx, final_text_box, reviewer_name, reason_code], outputs=action_outputs)
|
|
|
|
| 1297 |
next_btn.click(_next, inputs=[current_idx],
|
| 1298 |
outputs=[current_idx, review_image, raw_text_box, final_text_box, item_info])
|
| 1299 |
|
| 1300 |
+
# Auto-load removed β review loads on button click to avoid SSR hang
|
| 1301 |
|
| 1302 |
# ββ STEP 5: EXPORT ββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 1303 |
with gr.TabItem("β€ Export", id="ss-export"):
|