Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -64,9 +64,15 @@ def launch_gradio():
|
|
| 64 |
chatbot=gr.Chatbot(height=450),
|
| 65 |
)
|
| 66 |
|
| 67 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
|
| 69 |
-
|
|
|
|
| 70 |
["Chat", "Settings"])
|
| 71 |
|
| 72 |
demo.launch(auth=("admin", "leanvalue"))
|
|
|
|
| 64 |
chatbot=gr.Chatbot(height=450),
|
| 65 |
)
|
| 66 |
|
| 67 |
+
# 创建一个简单的按钮界面来触发 toggle_enable_chat 函数
|
| 68 |
+
toggle_chat_interface = gr.Interface(
|
| 69 |
+
fn=toggle_enable_chat,
|
| 70 |
+
inputs=gr.Button("Toggle Chat"),
|
| 71 |
+
outputs="text"
|
| 72 |
+
)
|
| 73 |
|
| 74 |
+
# 使用 TabbedInterface 来组合聊天界面和设置界面
|
| 75 |
+
demo = gr.TabbedInterface([chat_interface, toggle_chat_interface],
|
| 76 |
["Chat", "Settings"])
|
| 77 |
|
| 78 |
demo.launch(auth=("admin", "leanvalue"))
|