Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -52,7 +52,7 @@ def search(term, num_results=3, lang="en", advanced=True, timeout=5, safe="activ
|
|
52 |
while start < num_results:
|
53 |
resp = session.get(
|
54 |
url="https://www.google.com/search",
|
55 |
-
headers={"User-Agent":
|
56 |
params={
|
57 |
"q": term,
|
58 |
"num": num_results - start,
|
@@ -153,8 +153,8 @@ async def respond(audio, web_search):
|
|
153 |
with gr.Blocks() as demo:
|
154 |
with gr.Row():
|
155 |
web_search = gr.Checkbox(label="Web Search", value=False)
|
156 |
-
input = gr.Audio(label="Voice Chat
|
157 |
-
output = gr.Audio(label="
|
158 |
gr.Interface(fn=respond, inputs=[input, web_search], outputs=[output], live=True)
|
159 |
|
160 |
if __name__ == "__main__":
|
|
|
52 |
while start < num_results:
|
53 |
resp = session.get(
|
54 |
url="https://www.google.com/search",
|
55 |
+
headers={"User-Agent":'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36 Edg/111.0.1661.62'},
|
56 |
params={
|
57 |
"q": term,
|
58 |
"num": num_results - start,
|
|
|
153 |
with gr.Blocks() as demo:
|
154 |
with gr.Row():
|
155 |
web_search = gr.Checkbox(label="Web Search", value=False)
|
156 |
+
input = gr.Audio(label="Voice Chat", sources="microphone", type="numpy")
|
157 |
+
output = gr.Audio(label="AI",autoplay=True)
|
158 |
gr.Interface(fn=respond, inputs=[input, web_search], outputs=[output], live=True)
|
159 |
|
160 |
if __name__ == "__main__":
|