Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -68,15 +68,18 @@ with gr.Blocks() as demo:
|
|
68 |
with gr.Row():
|
69 |
# 左邊:控制按鈕與狀態欄
|
70 |
with gr.Column(scale=1):
|
71 |
-
|
72 |
-
|
|
|
73 |
textbox_input = gr.Textbox(label="Prompt", lines=1, placeholder="Enter prompt here...")
|
74 |
button = gr.Button("Submit")
|
75 |
-
|
|
|
76 |
# 右邊:Prompt 輸入與 Markdown 輸出
|
77 |
with gr.Column(scale=3):
|
78 |
-
|
79 |
-
|
|
|
80 |
textbox_output = gr.Markdown(label="robot answer:", elem_id="scroll_output")
|
81 |
|
82 |
|
|
|
68 |
with gr.Row():
|
69 |
# 左邊:控制按鈕與狀態欄
|
70 |
with gr.Column(scale=1):
|
71 |
+
with gr.Row():
|
72 |
+
start_btn = gr.Button("開始對話")
|
73 |
+
end_btn = gr.Button("結束對話")
|
74 |
textbox_input = gr.Textbox(label="Prompt", lines=1, placeholder="Enter prompt here...")
|
75 |
button = gr.Button("Submit")
|
76 |
+
start_btn.click(fn=start_chat, outputs=status_box)
|
77 |
+
end_btn.click(fn=finish_chat, outputs=status_box)
|
78 |
# 右邊:Prompt 輸入與 Markdown 輸出
|
79 |
with gr.Column(scale=3):
|
80 |
+
with gr.Row():
|
81 |
+
status_box = gr.Textbox(label="狀態", interactive=False)
|
82 |
+
TPS_box = gr.Textbox(label="TPS", interactive=False)
|
83 |
textbox_output = gr.Markdown(label="robot answer:", elem_id="scroll_output")
|
84 |
|
85 |
|