Update app.py
Browse files
app.py
CHANGED
|
@@ -22,7 +22,7 @@ with gr.Blocks(
|
|
| 22 |
}
|
| 23 |
"""
|
| 24 |
) as app:
|
| 25 |
-
#
|
| 26 |
chat = gr.ChatInterface(
|
| 27 |
fn=process_user_request,
|
| 28 |
chatbot=gr.Chatbot(
|
|
@@ -32,10 +32,7 @@ with gr.Blocks(
|
|
| 32 |
scale=1
|
| 33 |
),
|
| 34 |
type="messages",
|
| 35 |
-
submit_btn="Send",
|
| 36 |
-
retry_btn="Retry",
|
| 37 |
-
undo_btn="Undo",
|
| 38 |
-
clear_btn="Clear",
|
| 39 |
examples=[
|
| 40 |
["#news Open-source LLM trends [條列] depth:2"],
|
| 41 |
["#papers P-wave picking with AI [表格]"],
|
|
@@ -49,7 +46,7 @@ with gr.Blocks(
|
|
| 49 |
concurrency_limit=5,
|
| 50 |
)
|
| 51 |
|
| 52 |
-
# 側欄:說明 +
|
| 53 |
with gr.Sidebar():
|
| 54 |
gr.HTML(DESCRIPTION)
|
| 55 |
gr.Markdown("### ⚡ 一鍵範例")
|
|
|
|
| 22 |
}
|
| 23 |
"""
|
| 24 |
) as app:
|
| 25 |
+
# ChatInterface 使用舊版支援的參數
|
| 26 |
chat = gr.ChatInterface(
|
| 27 |
fn=process_user_request,
|
| 28 |
chatbot=gr.Chatbot(
|
|
|
|
| 32 |
scale=1
|
| 33 |
),
|
| 34 |
type="messages",
|
| 35 |
+
submit_btn="Send", # 舊版只支援 submit_btn
|
|
|
|
|
|
|
|
|
|
| 36 |
examples=[
|
| 37 |
["#news Open-source LLM trends [條列] depth:2"],
|
| 38 |
["#papers P-wave picking with AI [表格]"],
|
|
|
|
| 46 |
concurrency_limit=5,
|
| 47 |
)
|
| 48 |
|
| 49 |
+
# 側欄:說明 + 一鍵示例
|
| 50 |
with gr.Sidebar():
|
| 51 |
gr.HTML(DESCRIPTION)
|
| 52 |
gr.Markdown("### ⚡ 一鍵範例")
|