Spaces:
Runtime error
Runtime error
Upload app.py
Browse files
app.py
CHANGED
|
@@ -243,9 +243,7 @@ import gradio as gr
|
|
| 243 |
|
| 244 |
theme = gr.themes.Base(primary_hue="slate")
|
| 245 |
|
| 246 |
-
|
| 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)
|
|
@@ -275,6 +273,11 @@ with gr.Blocks(theme=theme, css=css) as demo:
|
|
| 275 |
with gr.Column(elem_id="chat-interface"):
|
| 276 |
chat = gr.Chatbot(elem_id="chat-messages", show_label=False)
|
| 277 |
with gr.Row(elem_id="suggestions"):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 278 |
sugg1 = gr.Button(suggestion_text_1, elem_classes="suggestion-btn").click(
|
| 279 |
suggestion1, outputs=chat
|
| 280 |
)
|
|
@@ -284,6 +287,7 @@ with gr.Blocks(theme=theme, css=css) as demo:
|
|
| 284 |
sugg3 = gr.Button(suggestion_text_3, elem_classes="suggestion-btn").click(
|
| 285 |
suggestion3, outputs=chat
|
| 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")
|
|
|
|
| 243 |
|
| 244 |
theme = gr.themes.Base(primary_hue="slate")
|
| 245 |
|
| 246 |
+
suggestion = ["What are the latest advancements in cancer research ?","What is the impact of diet on heart disease according to recent studies ?","What are the usual causes of lung pain ?"]
|
|
|
|
|
|
|
| 247 |
|
| 248 |
def respond(message,chat_history):
|
| 249 |
response = generate_text(message)
|
|
|
|
| 273 |
with gr.Column(elem_id="chat-interface"):
|
| 274 |
chat = gr.Chatbot(elem_id="chat-messages", show_label=False)
|
| 275 |
with gr.Row(elem_id="suggestions"):
|
| 276 |
+
for i in suggestion:
|
| 277 |
+
gr.Button(suggestion[i], elem_classes="suggestion-btn").click(
|
| 278 |
+
respond(suggestion[i],chat)
|
| 279 |
+
)
|
| 280 |
+
"""
|
| 281 |
sugg1 = gr.Button(suggestion_text_1, elem_classes="suggestion-btn").click(
|
| 282 |
suggestion1, outputs=chat
|
| 283 |
)
|
|
|
|
| 287 |
sugg3 = gr.Button(suggestion_text_3, elem_classes="suggestion-btn").click(
|
| 288 |
suggestion3, outputs=chat
|
| 289 |
)
|
| 290 |
+
"""
|
| 291 |
with gr.Row(elem_id="input-area"):
|
| 292 |
text_input = gr.Textbox(placeholder="Write to ALOQAS...", show_label=False)
|
| 293 |
#send_button = gr.Button("Send", elem_classes="send")
|