This commit is contained in:
hailin 2025-07-27 15:32:23 +08:00
parent 5d640d814b
commit c2b7ec20b8
1 changed files with 3 additions and 3 deletions

View File

@ -96,9 +96,9 @@ with gr.Blocks(title="调试界面") as demo:
log_box = gr.Textbox(label="实时日志", lines=20, interactive=False, visible=True)
log_state= gr.State("") # 保存全部日志文本
# 定时刷新日志
logger = gr.Interval(1.0, visible=False)
logger.set_event_trigger(
# ────────────── 定时刷新日志 ──────────────
logger = gr.Timer(value=1.0, render=False) # 每 1秒 tick 一次(取代 gr.Interval
logger.tick(
fn=consume_logs,
inputs=log_state,
outputs=log_state