Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,7 +16,7 @@ def search(subject):
|
|
| 16 |
#search the news for subject
|
| 17 |
base_url = "https://www.bing.com/search"
|
| 18 |
query = requests.utils.quote(subject)
|
| 19 |
-
count =
|
| 20 |
url = f"{base_url}?q={query}&count={count}"
|
| 21 |
response = requests.get(url)
|
| 22 |
if response.status_code == 200:
|
|
@@ -53,19 +53,18 @@ def answer(inp):
|
|
| 53 |
return pipe(chat)
|
| 54 |
|
| 55 |
# %%
|
| 56 |
-
output = answer(input("enter question"))
|
| 57 |
-
print(output)
|
| 58 |
|
| 59 |
# %%
|
| 60 |
with gr.Blocks() as demo:
|
| 61 |
gr.Markdown("# News Analysis Assistant")
|
| 62 |
with gr.Row():
|
| 63 |
-
with gr.Column():
|
| 64 |
subject = gr.Textbox(label="Subject")
|
|
|
|
|
|
|
| 65 |
submit = gr.Button("Submit")
|
| 66 |
-
|
| 67 |
-
results = gr.HTML()
|
| 68 |
-
submit.click(search, inputs=subject, outputs=results)
|
| 69 |
demo.launch(share=True)
|
| 70 |
|
| 71 |
|
|
|
|
| 16 |
#search the news for subject
|
| 17 |
base_url = "https://www.bing.com/search"
|
| 18 |
query = requests.utils.quote(subject)
|
| 19 |
+
count = 3
|
| 20 |
url = f"{base_url}?q={query}&count={count}"
|
| 21 |
response = requests.get(url)
|
| 22 |
if response.status_code == 200:
|
|
|
|
| 53 |
return pipe(chat)
|
| 54 |
|
| 55 |
# %%
|
| 56 |
+
#output = answer(input("enter question"))
|
| 57 |
+
#print(output)
|
| 58 |
|
| 59 |
# %%
|
| 60 |
with gr.Blocks() as demo:
|
| 61 |
gr.Markdown("# News Analysis Assistant")
|
| 62 |
with gr.Row():
|
|
|
|
| 63 |
subject = gr.Textbox(label="Subject")
|
| 64 |
+
results = gr.Textbox()
|
| 65 |
+
with gr.Row():
|
| 66 |
submit = gr.Button("Submit")
|
| 67 |
+
submit.click(answer, inputs=subject, outputs=results)
|
|
|
|
|
|
|
| 68 |
demo.launch(share=True)
|
| 69 |
|
| 70 |
|