Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -1245,10 +1245,8 @@ examples = [
|
|
1245 |
]
|
1246 |
|
1247 |
# Function to insert the prompt into the textbox when clicked
|
1248 |
-
def insert_prompt(prompt):
|
1249 |
-
|
1250 |
-
return prompt[0]
|
1251 |
-
return ""
|
1252 |
|
1253 |
|
1254 |
|
@@ -1340,7 +1338,7 @@ with gr.Blocks(theme='Pijush2023/scikit-learn-pijush') as demo:
|
|
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())
|
|
|
1245 |
]
|
1246 |
|
1247 |
# Function to insert the prompt into the textbox when clicked
|
1248 |
+
def insert_prompt(current_text, prompt):
|
1249 |
+
return prompt[0] if prompt else current_text
|
|
|
|
|
1250 |
|
1251 |
|
1252 |
|
|
|
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,inputs=chat_input, outputs=chat_input)
|
1342 |
|
1343 |
with gr.Column():
|
1344 |
weather_output = gr.HTML(value=fetch_local_weather())
|