Update app.py
Browse files
app.py
CHANGED
|
@@ -787,18 +787,22 @@ with gr.Blocks() as demo:
|
|
| 787 |
submit_button.click(chat, inputs=[question_input, chatbot, temperature_slider, top_p_slider, repetition_penalty_slider, web_search_checkbox, google_news_rss_checkbox], outputs=[question_input, chatbot])
|
| 788 |
|
| 789 |
with gr.Row():
|
| 790 |
-
|
|
|
|
| 791 |
choices=list(website_configs.keys()),
|
| 792 |
-
label="Select
|
| 793 |
value=list(website_configs.keys())[0]
|
| 794 |
)
|
| 795 |
-
fetch_news_button = gr.Button("Fetch
|
| 796 |
|
| 797 |
news_fetch_output = gr.Textbox(label="News Fetch Status")
|
| 798 |
|
|
|
|
|
|
|
|
|
|
| 799 |
fetch_news_button.click(
|
| 800 |
-
|
| 801 |
-
inputs=[
|
| 802 |
outputs=news_fetch_output
|
| 803 |
)
|
| 804 |
|
|
|
|
| 787 |
submit_button.click(chat, inputs=[question_input, chatbot, temperature_slider, top_p_slider, repetition_penalty_slider, web_search_checkbox, google_news_rss_checkbox], outputs=[question_input, chatbot])
|
| 788 |
|
| 789 |
with gr.Row():
|
| 790 |
+
news_query_input = gr.Textbox(label="News Query")
|
| 791 |
+
news_source_dropdown = gr.Dropdown(
|
| 792 |
choices=list(website_configs.keys()),
|
| 793 |
+
label="Select News Source",
|
| 794 |
value=list(website_configs.keys())[0]
|
| 795 |
)
|
| 796 |
+
fetch_news_button = gr.Button("Fetch News")
|
| 797 |
|
| 798 |
news_fetch_output = gr.Textbox(label="News Fetch Status")
|
| 799 |
|
| 800 |
+
def fetch_news(query, temperature, top_p, repetition_penalty, news_source):
|
| 801 |
+
return process_news(query, temperature, top_p, repetition_penalty, news_source)
|
| 802 |
+
|
| 803 |
fetch_news_button.click(
|
| 804 |
+
fetch_news,
|
| 805 |
+
inputs=[news_query_input, temperature_slider, top_p_slider, repetition_penalty_slider, news_source_dropdown],
|
| 806 |
outputs=news_fetch_output
|
| 807 |
)
|
| 808 |
|