Spaces:
Runtime error
Runtime error
acecalisto3
commited on
Commit
•
5df9041
1
Parent(s):
26576f8
Update app.py
Browse files
app.py
CHANGED
@@ -275,31 +275,6 @@ with gr.Blocks() as demo:
|
|
275 |
placeholder="Type your message here...")
|
276 |
send_button = gr.Button("Send")
|
277 |
|
278 |
-
async def on_start_click(target_urls_str: str, storage_loc: str,
|
279 |
-
feed_enabled: bool):
|
280 |
-
urls = [url.strip() for url in target_urls_str.split(",")]
|
281 |
-
await start_monitoring(urls, storage_loc if storage_loc else None,
|
282 |
-
feed_enabled)
|
283 |
-
return "Monitoring started for valid URLs."
|
284 |
-
|
285 |
-
async def on_stop_click():
|
286 |
-
for url in list(monitoring_tasks.keys()):
|
287 |
-
stop_monitoring(url)
|
288 |
-
return "Monitoring stopped for all URLs."
|
289 |
-
|
290 |
-
start_button.click(
|
291 |
-
on_start_click,
|
292 |
-
inputs=[target_urls, storage_location, feed_rss_checkbox],
|
293 |
-
outputs=[status_text])
|
294 |
-
stop_button.click(on_stop_click, outputs=[status_text])
|
295 |
-
send_button.click(
|
296 |
-
chatbot_response,
|
297 |
-
inputs=[message_input, chatbot_interface],
|
298 |
-
outputs=[chatbot_interface, chatbot_interface])
|
299 |
-
|
300 |
-
# Start the periodic update task
|
301 |
-
asyncio.create_task(periodic_update())
|
302 |
-
|
303 |
if __name__ == "__main__":
|
304 |
loop = asyncio.get_event_loop()
|
305 |
if not loop.is_running():
|
|
|
275 |
placeholder="Type your message here...")
|
276 |
send_button = gr.Button("Send")
|
277 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
278 |
if __name__ == "__main__":
|
279 |
loop = asyncio.get_event_loop()
|
280 |
if not loop.is_running():
|