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