This commit is contained in:
hailin 2025-07-27 16:05:31 +08:00
parent 3e8115b036
commit 6137a2e0d3
1 changed files with 5 additions and 5 deletions

View File

@ -105,11 +105,11 @@ with gr.Blocks(title="调试界面") as demo:
# ) # )
# ────────────── 定时刷新日志 ────────────── # ────────────── 定时刷新日志 ──────────────
logger = gr.Timer(1.0, render=False) # 每 1秒触发一次 timer = gr.Timer(1.0, render=False) # 每秒触发一次
logger.tick( timer.then(
fn=consume_logs, consume_logs, # 把队列里的新日志取出来
inputs=[log_state], inputs=[log_box], # 直接把当前 Textbox 的内容当输入
outputs=[log_state], outputs=[log_box], # 把合并后的文本写回 Textbox
) )
# 显示到 log_box # 显示到 log_box