datasense commited on
Commit
1e39009
·
1 Parent(s): 2567543

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -64,9 +64,15 @@ def launch_gradio():
64
  chatbot=gr.Chatbot(height=450),
65
  )
66
 
67
- toggle_chat_button = gr.Button(value="Toggle Chat", fn=toggle_enable_chat)
 
 
 
 
 
68
 
69
- demo = gr.TabbedInterface([chat_interface, toggle_chat_button],
 
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"))