Spaces:
Runtime error
Runtime error
CognitiveScience
commited on
Commit
·
7dd86cc
1
Parent(s):
a9e36fb
Update app.py
Browse files
app.py
CHANGED
@@ -113,12 +113,12 @@ def respond3(message, chat_history):
|
|
113 |
with gr.Blocks() as demo:
|
114 |
with gr.Row():
|
115 |
with gr.Column():
|
116 |
-
cschatbot = gr.Chatbot()
|
117 |
-
csinp = gr.Textbox()
|
118 |
-
csout=cs(csinp)
|
119 |
-
csclear = gr.ClearButton([csinp, cschatbot])
|
120 |
|
121 |
-
csinp.submit(cs, csinp,
|
122 |
|
123 |
with gr.Row():
|
124 |
with gr.Column():
|
@@ -145,14 +145,14 @@ with gr.Blocks() as demo:
|
|
145 |
msg2 = gr.Textbox()
|
146 |
clear2 = gr.ClearButton([msg2, chatbot2])
|
147 |
|
148 |
-
def respond2(message
|
149 |
-
bot_message = random.choice(["How are you?", "I love you", "I'm very hungry"])
|
150 |
chat_history.append((message, bot_message))
|
151 |
time.sleep(2)
|
152 |
|
153 |
-
return "", chat_history
|
154 |
|
155 |
-
msg2.submit(respond2,
|
156 |
|
157 |
with gr.Column():
|
158 |
submitsave = gr.Button(value="Save")
|
|
|
113 |
with gr.Blocks() as demo:
|
114 |
with gr.Row():
|
115 |
with gr.Column():
|
116 |
+
#cschatbot = gr.Chatbot()
|
117 |
+
#csinp = gr.Textbox()
|
118 |
+
#csout=cs(csinp)
|
119 |
+
#csclear = gr.ClearButton([csinp, cschatbot])
|
120 |
|
121 |
+
#csinp.submit(cs, [csinp, cschatbot], [csinp, cschatbot])
|
122 |
|
123 |
with gr.Row():
|
124 |
with gr.Column():
|
|
|
145 |
msg2 = gr.Textbox()
|
146 |
clear2 = gr.ClearButton([msg2, chatbot2])
|
147 |
|
148 |
+
def respond2(message):
|
149 |
+
bot_message = "hii" + message #random.choice(["How are you?", "I love you", "I'm very hungry"])
|
150 |
chat_history.append((message, bot_message))
|
151 |
time.sleep(2)
|
152 |
|
153 |
+
return bot_message #"", chat_history
|
154 |
|
155 |
+
msg2.submit(respond2, bot_message, bot_message)
|
156 |
|
157 |
with gr.Column():
|
158 |
submitsave = gr.Button(value="Save")
|