Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -1244,7 +1244,11 @@ examples = [
|
|
1244 |
]
|
1245 |
]
|
1246 |
|
1247 |
-
|
|
|
|
|
|
|
|
|
1248 |
|
1249 |
|
1250 |
|
@@ -1278,9 +1282,7 @@ with gr.Blocks(theme='Pijush2023/scikit-learn-pijush') as demo:
|
|
1278 |
audio_output.stop()
|
1279 |
return None
|
1280 |
|
1281 |
-
|
1282 |
-
def insert_prompt(prompt):
|
1283 |
-
return prompt[0]
|
1284 |
|
1285 |
# retriever_sequence = (
|
1286 |
# retriever_button.click(fn=stop_audio, inputs=[], outputs=[audio_output], api_name="api_stop_audio_recording")
|
@@ -1338,7 +1340,7 @@ with gr.Blocks(theme='Pijush2023/scikit-learn-pijush') as demo:
|
|
1338 |
audio_input = gr.Audio(sources=["microphone"], streaming=True, type='numpy', every=0.1)
|
1339 |
audio_input.stream(transcribe_function, inputs=[state, audio_input], outputs=[state, chat_input], api_name="api_voice_to_text")
|
1340 |
|
1341 |
-
gr.Examples(examples=examples, fn=insert_prompt,
|
1342 |
|
1343 |
with gr.Column():
|
1344 |
weather_output = gr.HTML(value=fetch_local_weather())
|
|
|
1244 |
]
|
1245 |
]
|
1246 |
|
1247 |
+
# Function to insert the prompt into the textbox when clicked
|
1248 |
+
def insert_prompt(prompt):
|
1249 |
+
if prompt is not None and len(prompt) > 0:
|
1250 |
+
return prompt[0]
|
1251 |
+
return ""
|
1252 |
|
1253 |
|
1254 |
|
|
|
1282 |
audio_output.stop()
|
1283 |
return None
|
1284 |
|
1285 |
+
|
|
|
|
|
1286 |
|
1287 |
# retriever_sequence = (
|
1288 |
# retriever_button.click(fn=stop_audio, inputs=[], outputs=[audio_output], api_name="api_stop_audio_recording")
|
|
|
1340 |
audio_input = gr.Audio(sources=["microphone"], streaming=True, type='numpy', every=0.1)
|
1341 |
audio_input.stream(transcribe_function, inputs=[state, audio_input], outputs=[state, chat_input], api_name="api_voice_to_text")
|
1342 |
|
1343 |
+
gr.Examples(examples=examples, fn=insert_prompt, outputs=chat_input)
|
1344 |
|
1345 |
with gr.Column():
|
1346 |
weather_output = gr.HTML(value=fetch_local_weather())
|