Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -41,6 +41,7 @@ with gr.Blocks(css = "custom.css") as demo:
|
|
41 |
def user(user_message, history):
|
42 |
return "", history + [[user_message, None]]
|
43 |
|
|
|
44 |
def bot_api(user_message):
|
45 |
l = user_message.split("[SEP]")
|
46 |
history = []
|
@@ -67,6 +68,7 @@ with gr.Blocks(css = "custom.css") as demo:
|
|
67 |
user_message_out.append(e)
|
68 |
user_message_out = "[SEP]".join(user_message_out)
|
69 |
return user_message_out
|
|
|
70 |
|
71 |
def bot(history):
|
72 |
'''
|
@@ -99,18 +101,20 @@ with gr.Blocks(css = "custom.css") as demo:
|
|
99 |
interactive=True,
|
100 |
#info = "Generate by Click, and can edit by yourself, look up Examples below"
|
101 |
)
|
102 |
-
msg_out = gr.Textbox(visible = False)
|
103 |
sub_button = gr.Button("Submit")
|
104 |
clear = gr.Button("Clear")
|
105 |
-
api_button = gr.Button("api", visible = False)
|
106 |
|
107 |
sub_button.click(user, [msg, chatbot], [msg, chatbot], queue=False).then(
|
108 |
bot, chatbot, chatbot
|
109 |
)
|
110 |
|
|
|
111 |
api_button.click(
|
112 |
bot_api, msg, msg_out
|
113 |
)
|
|
|
114 |
|
115 |
clear.click(lambda: None, None, chatbot, queue=False)
|
116 |
|
|
|
41 |
def user(user_message, history):
|
42 |
return "", history + [[user_message, None]]
|
43 |
|
44 |
+
'''
|
45 |
def bot_api(user_message):
|
46 |
l = user_message.split("[SEP]")
|
47 |
history = []
|
|
|
68 |
user_message_out.append(e)
|
69 |
user_message_out = "[SEP]".join(user_message_out)
|
70 |
return user_message_out
|
71 |
+
'''
|
72 |
|
73 |
def bot(history):
|
74 |
'''
|
|
|
101 |
interactive=True,
|
102 |
#info = "Generate by Click, and can edit by yourself, look up Examples below"
|
103 |
)
|
104 |
+
#msg_out = gr.Textbox(visible = False)
|
105 |
sub_button = gr.Button("Submit")
|
106 |
clear = gr.Button("Clear")
|
107 |
+
#api_button = gr.Button("api", visible = False)
|
108 |
|
109 |
sub_button.click(user, [msg, chatbot], [msg, chatbot], queue=False).then(
|
110 |
bot, chatbot, chatbot
|
111 |
)
|
112 |
|
113 |
+
'''
|
114 |
api_button.click(
|
115 |
bot_api, msg, msg_out
|
116 |
)
|
117 |
+
'''
|
118 |
|
119 |
clear.click(lambda: None, None, chatbot, queue=False)
|
120 |
|