Spaces:
Runtime error
Runtime error
Upload app.py
Browse files
app.py
CHANGED
@@ -247,17 +247,14 @@ suggestion_text_1 = "What are the latest advancements in cancer research ?"
|
|
247 |
suggestion_text_2 = "What is the impact of diet on heart disease according to recent studies ?"
|
248 |
suggestion_text_3 = "What are the usual causes of lung pain ?"
|
249 |
|
250 |
-
def respond(message):
|
251 |
response = generate_text(message)
|
252 |
-
|
253 |
-
|
254 |
-
def respond(message):
|
255 |
-
response = generate_text(message)
|
256 |
-
return [["bot", response]]
|
257 |
|
258 |
def suggestion1():
|
259 |
response = generate_text(suggestion_text_1)
|
260 |
-
return [
|
261 |
|
262 |
def suggestion2():
|
263 |
response = generate_text(suggestion_text_2)
|
@@ -289,12 +286,13 @@ with gr.Blocks(theme=theme, css=css) as demo:
|
|
289 |
)
|
290 |
with gr.Row(elem_id="input-area"):
|
291 |
text_input = gr.Textbox(placeholder="Write to ALOQAS...", show_label=False)
|
292 |
-
send_button = gr.Button("Send", elem_classes="send")
|
293 |
-
send_button.click(
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
)
|
|
|
298 |
|
299 |
demo.launch(share=False)
|
300 |
|
|
|
247 |
suggestion_text_2 = "What is the impact of diet on heart disease according to recent studies ?"
|
248 |
suggestion_text_3 = "What are the usual causes of lung pain ?"
|
249 |
|
250 |
+
def respond(message,chat_history):
|
251 |
response = generate_text(message)
|
252 |
+
chat_history.append((message, response))
|
253 |
+
return "bot", chat_history
|
|
|
|
|
|
|
254 |
|
255 |
def suggestion1():
|
256 |
response = generate_text(suggestion_text_1)
|
257 |
+
return [suggestion_text_1,response]
|
258 |
|
259 |
def suggestion2():
|
260 |
response = generate_text(suggestion_text_2)
|
|
|
286 |
)
|
287 |
with gr.Row(elem_id="input-area"):
|
288 |
text_input = gr.Textbox(placeholder="Write to ALOQAS...", show_label=False)
|
289 |
+
#send_button = gr.Button("Send", elem_classes="send")
|
290 |
+
#send_button.click(
|
291 |
+
# fn=respond,
|
292 |
+
# inputs=text_input,
|
293 |
+
# outputs=chat
|
294 |
+
#)
|
295 |
+
text_input.submit(respond, [text_input, chatbot], [text_input, chatbot])
|
296 |
|
297 |
demo.launch(share=False)
|
298 |
|