Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -1077,7 +1077,7 @@ def fetch_local_news():
|
|
1077 |
api_key = os.environ['SERP_API']
|
1078 |
url = f'https://serpapi.com/search.json?engine=google_news&q=birmingham headline&api_key={api_key}'
|
1079 |
response = requests.get(url)
|
1080 |
-
if response.status_code == 200
|
1081 |
results = response.json().get("news_results", [])
|
1082 |
news_html = """
|
1083 |
<h2 style="font-family: 'Georgia', serif; color: #ff0000; background-color: #f8f8f8; padding: 10px; border-radius: 10px;">Birmingham Today</h2>
|
@@ -1393,7 +1393,7 @@ with gr.Blocks(theme='Pijush2023/scikit-learn-pijush') as demo:
|
|
1393 |
clear_button.click(fn=clear_textbox, inputs=None, outputs=chat_input)
|
1394 |
|
1395 |
audio_input = gr.Audio(sources=["microphone"], streaming=False, type='numpy')
|
1396 |
-
audio_input.change(fn=transcribe_function, inputs=[
|
1397 |
|
1398 |
send_chunk_button = gr.Button("Send chunk")
|
1399 |
send_chunk_button.click(fn=push_to_input, inputs=[transcription_state], outputs=chat_input)
|
@@ -1414,3 +1414,4 @@ demo.launch(share=True)
|
|
1414 |
|
1415 |
|
1416 |
|
|
|
|
1077 |
api_key = os.environ['SERP_API']
|
1078 |
url = f'https://serpapi.com/search.json?engine=google_news&q=birmingham headline&api_key={api_key}'
|
1079 |
response = requests.get(url)
|
1080 |
+
if response.status_code == 200){
|
1081 |
results = response.json().get("news_results", [])
|
1082 |
news_html = """
|
1083 |
<h2 style="font-family: 'Georgia', serif; color: #ff0000; background-color: #f8f8f8; padding: 10px; border-radius: 10px;">Birmingham Today</h2>
|
|
|
1393 |
clear_button.click(fn=clear_textbox, inputs=None, outputs=chat_input)
|
1394 |
|
1395 |
audio_input = gr.Audio(sources=["microphone"], streaming=False, type='numpy')
|
1396 |
+
audio_input.change(fn=transcribe_function, inputs=[state, audio_input], outputs=[state, transcription_state], api_name="voice_query_to_text")
|
1397 |
|
1398 |
send_chunk_button = gr.Button("Send chunk")
|
1399 |
send_chunk_button.click(fn=push_to_input, inputs=[transcription_state], outputs=chat_input)
|
|
|
1414 |
|
1415 |
|
1416 |
|
1417 |
+
|