Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Commit
•
bd97257
1
Parent(s):
89233f9
use 12 hour cron schedule
Browse files
app.py
CHANGED
@@ -287,8 +287,7 @@ def create_discussion_text_body(dataset_id, new_models, users_to_notify):
|
|
287 |
]
|
288 |
markdown_list = "\n".join(markdown_items)
|
289 |
description += markdown_list
|
290 |
-
description += """\n\n This discussion was created by the [Dataset to Model Monitor](https://huggingface.co/spaces/librarian-bots/dataset-to-model-monitor) Space.
|
291 |
-
You can modify your alerts using this Space."""
|
292 |
return description
|
293 |
|
294 |
|
@@ -444,13 +443,13 @@ with gr.Blocks() as demo:
|
|
444 |
user_stats_btn.click(user_stats, [], output)
|
445 |
scheduler = BackgroundScheduler()
|
446 |
|
447 |
-
|
448 |
-
scheduler.add_job(notify_about_new_models, "interval", minutes=
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
scheduler.start()
|
455 |
demo.queue(max_size=5)
|
456 |
demo.launch()
|
|
|
287 |
]
|
288 |
markdown_list = "\n".join(markdown_items)
|
289 |
description += markdown_list
|
290 |
+
description += """\n\n This discussion was created by the [Dataset to Model Monitor](https://huggingface.co/spaces/librarian-bots/dataset-to-model-monitor) Space. You can modify your alerts using this Space."""
|
|
|
291 |
return description
|
292 |
|
293 |
|
|
|
443 |
user_stats_btn.click(user_stats, [], output)
|
444 |
scheduler = BackgroundScheduler()
|
445 |
|
446 |
+
if local:
|
447 |
+
scheduler.add_job(notify_about_new_models, "interval", minutes=5)
|
448 |
+
else:
|
449 |
+
scheduler.add_job(
|
450 |
+
notify_about_new_models,
|
451 |
+
CronTrigger.from_crontab("0 */12 * * *"),
|
452 |
+
)
|
453 |
scheduler.start()
|
454 |
demo.queue(max_size=5)
|
455 |
demo.launch()
|