This commit is contained in:
hailin 2025-07-27 17:24:27 +08:00
parent 7bdc80cd1e
commit 44c3814d13
1 changed files with 3 additions and 11 deletions

View File

@ -129,23 +129,15 @@ with gr.Blocks(title="调试界面") as demo:
log_box = gr.Textbox(label="实时日志", lines=20, interactive=False, visible=False) # ✅ 默认隐藏 log_box = gr.Textbox(label="实时日志", lines=20, interactive=False, visible=False) # ✅ 默认隐藏
# Chat 界面(移到日志之前) # Chat 界面(移到日志之前)
# chatbot = gr.ChatInterface(
# fn=chat,
# additional_inputs=[max_new, temp, top_p, top_k,
# rep_pen, pres_pen, stop_txt, log_state],
# additional_outputs=[log_state],
# type="messages"
# )
chatbot = gr.ChatInterface( chatbot = gr.ChatInterface(
fn=chat, fn=chat,
textbox=gr.Textbox(lines=2, placeholder="文本...", label="Prompt"), additional_inputs=[max_new, temp, top_p, top_k,
submit_btn=gr.Button(value="", icon="send"), rep_pen, pres_pen, stop_txt, log_state],
additional_inputs=[max_new, temp, top_p, top_k, rep_pen, pres_pen, stop_txt, log_state],
additional_outputs=[log_state], additional_outputs=[log_state],
type="messages" type="messages"
) )
# 日志刷新定时器 # 日志刷新定时器
timer = gr.Timer(1.0, render=True) timer = gr.Timer(1.0, render=True)
timer.tick( timer.tick(