Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -1305,26 +1305,20 @@ def fetch_google_flights(departure_id="JFK", arrival_id="BHM", outbound_date=cur
|
|
1305 |
# demo.queue()
|
1306 |
# demo.launch(show_error=True)
|
1307 |
|
1308 |
-
|
1309 |
-
import gradio as gr
|
1310 |
-
|
1311 |
-
# List of example prompts
|
1312 |
example_prompts = [
|
1313 |
-
"What are
|
1314 |
-
"
|
1315 |
-
"What events are happening in Birmingham today?",
|
1316 |
-
"
|
1317 |
-
"
|
1318 |
]
|
1319 |
|
1320 |
-
#
|
1321 |
-
|
1322 |
-
|
1323 |
-
var inputBox = document.querySelector('#chat-input textarea');
|
1324 |
-
inputBox.value = text;
|
1325 |
-
}
|
1326 |
-
"""
|
1327 |
|
|
|
1328 |
with gr.Blocks(theme='Pijush2023/scikit-learn-pijush') as demo:
|
1329 |
with gr.Row():
|
1330 |
with gr.Column():
|
@@ -1339,15 +1333,11 @@ with gr.Blocks(theme='Pijush2023/scikit-learn-pijush') as demo:
|
|
1339 |
|
1340 |
gr.Markdown("<h1 style='color: red;'>Talk to RADAR</h1>", elem_id="voice-markdown")
|
1341 |
|
1342 |
-
# Example
|
1343 |
-
|
1344 |
-
|
1345 |
-
example_prompts_html += f"<tr><td><a href='javascript:void(0);' onclick=\"insertPrompt('{prompt}');\">{prompt}</a></td></tr>"
|
1346 |
-
example_prompts_html += "</table>"
|
1347 |
|
1348 |
-
gr.
|
1349 |
-
|
1350 |
-
chat_input = gr.Textbox(show_copy_button=True, interactive=True, show_label=False, label="ASK Radar !!!", placeholder="Hey Radar...!!", elem_id="chat-input")
|
1351 |
tts_choice = gr.Radio(label="Select TTS System", choices=["Alpha", "Beta"], value="Alpha")
|
1352 |
retriever_button = gr.Button("Retriever")
|
1353 |
|
@@ -1391,3 +1381,5 @@ demo.queue()
|
|
1391 |
demo.launch(show_error=True)
|
1392 |
|
1393 |
|
|
|
|
|
|
1305 |
# demo.queue()
|
1306 |
# demo.launch(show_error=True)
|
1307 |
|
1308 |
+
# Define example prompts
|
|
|
|
|
|
|
1309 |
example_prompts = [
|
1310 |
+
["What are the best restaurants in Birmingham?"],
|
1311 |
+
["Can you suggest a good hotel in Birmingham for a family stay?"],
|
1312 |
+
["What events are happening in Birmingham today?"],
|
1313 |
+
["Tell me about some popular tourist spots in Birmingham."],
|
1314 |
+
["What is the weather like in Birmingham today?"]
|
1315 |
]
|
1316 |
|
1317 |
+
# Function to handle the insertion of example prompts into the input textbox
|
1318 |
+
def insert_example_prompt(example):
|
1319 |
+
return gr.Textbox.update(value=example)
|
|
|
|
|
|
|
|
|
1320 |
|
1321 |
+
# Your existing Gradio Blocks interface
|
1322 |
with gr.Blocks(theme='Pijush2023/scikit-learn-pijush') as demo:
|
1323 |
with gr.Row():
|
1324 |
with gr.Column():
|
|
|
1333 |
|
1334 |
gr.Markdown("<h1 style='color: red;'>Talk to RADAR</h1>", elem_id="voice-markdown")
|
1335 |
|
1336 |
+
# Example prompts component
|
1337 |
+
gr.Markdown("<h2>Example Prompts</h2>")
|
1338 |
+
gr.Examples(examples=example_prompts, fn=insert_example_prompt, inputs=None, outputs="chat_input")
|
|
|
|
|
1339 |
|
1340 |
+
chat_input = gr.Textbox(show_copy_button=True, interactive=True, show_label=False, label="ASK Radar !!!", placeholder="Hey Radar...!!")
|
|
|
|
|
1341 |
tts_choice = gr.Radio(label="Select TTS System", choices=["Alpha", "Beta"], value="Alpha")
|
1342 |
retriever_button = gr.Button("Retriever")
|
1343 |
|
|
|
1381 |
demo.launch(show_error=True)
|
1382 |
|
1383 |
|
1384 |
+
|
1385 |
+
|