Terry Zhuo commited on
Commit
8a21a5f
·
1 Parent(s): 123482b
Files changed (1) hide show
  1. app.py +22 -22
app.py CHANGED
@@ -636,31 +636,31 @@ def enable_space_ci_and_return_server(ui: gr.Blocks) -> WebhooksServer:
636
  storage=config.get("storage"),
637
  )
638
 
639
- # Create webhooks server (with CI url if in Space and not ephemeral)
640
- webhooks_server = enable_space_ci_and_return_server(ui=main_block)
641
-
642
- # Add webhooks
643
- @webhooks_server.add_webhook
644
- def update_leaderboard(payload: WebhookPayload) -> None:
645
- """Redownloads the leaderboard dataset each time it updates"""
646
- if payload.repo.type == "dataset" and payload.event.action == "update":
647
- global NEW_DATA_ON_LEADERBOARD
648
- if NEW_DATA_ON_LEADERBOARD:
649
- return
650
- NEW_DATA_ON_LEADERBOARD = True
651
-
652
- for repo in [RESULT_REPO, HARD_RESULT_REPO, ELO_REPO, HARD_ELO_REPO, SOLVE_REPO, HARD_SOLVE_REPO]:
653
- datasets.load_dataset(
654
- repo,
655
- "default",
656
- cache_dir=HF_HOME,
657
- download_mode=datasets.DownloadMode.FORCE_REDOWNLOAD,
658
- verification_mode="no_checks"
659
- )
660
 
661
 
662
 
663
- webhooks_server.launch()
664
 
665
  scheduler = BackgroundScheduler()
666
  scheduler.add_job(restart_space, "interval", hours=3) # restarted every 3h as backup in case automatic updates are not working
 
636
  storage=config.get("storage"),
637
  )
638
 
639
+ # # Create webhooks server (with CI url if in Space and not ephemeral)
640
+ # webhooks_server = enable_space_ci_and_return_server(ui=main_block)
641
+
642
+ # # Add webhooks
643
+ # @webhooks_server.add_webhook
644
+ # def update_leaderboard(payload: WebhookPayload) -> None:
645
+ # """Redownloads the leaderboard dataset each time it updates"""
646
+ # if payload.repo.type == "dataset" and payload.event.action == "update":
647
+ # global NEW_DATA_ON_LEADERBOARD
648
+ # if NEW_DATA_ON_LEADERBOARD:
649
+ # return
650
+ # NEW_DATA_ON_LEADERBOARD = True
651
+
652
+ # for repo in [RESULT_REPO, HARD_RESULT_REPO, ELO_REPO, HARD_ELO_REPO, SOLVE_REPO, HARD_SOLVE_REPO]:
653
+ # datasets.load_dataset(
654
+ # repo,
655
+ # "default",
656
+ # cache_dir=HF_HOME,
657
+ # download_mode=datasets.DownloadMode.FORCE_REDOWNLOAD,
658
+ # verification_mode="no_checks"
659
+ # )
660
 
661
 
662
 
663
+ # webhooks_server.launch()
664
 
665
  scheduler = BackgroundScheduler()
666
  scheduler.add_job(restart_space, "interval", hours=3) # restarted every 3h as backup in case automatic updates are not working