Wauplin HF staff commited on
Commit
049d19f
1 Parent(s): 2e93358

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -11
app.py CHANGED
@@ -2,7 +2,7 @@ import gradio as gr
2
  import pandas as pd
3
  from apscheduler.schedulers.background import BackgroundScheduler
4
  from huggingface_hub import snapshot_download
5
- from gradio_space_ci import configure_space_ci # FOR CI
6
 
7
  from src.display.about import (
8
  CITATION_BUTTON_LABEL,
@@ -37,6 +37,8 @@ from src.tools.plots import (
37
  create_scores_df,
38
  )
39
 
 
 
40
 
41
  def restart_space():
42
  API.restart_space(repo_id=REPO_ID, token=H4_TOKEN)
@@ -420,13 +422,4 @@ scheduler = BackgroundScheduler()
420
  scheduler.add_job(restart_space, "interval", seconds=10800)
421
  scheduler.start()
422
 
423
- # Both launches the space and its CI
424
- configure_space_ci(
425
- demo.queue(default_concurrency_limit=40),
426
- trusted_authors=[], # add manually trusted authors
427
- private="True", # ephemeral spaces will have same visibility as the main space. Otherwise, set to `True` or `False` explicitly.
428
- variables={}, # We overwrite HF_HOME as tmp CI spaces will have no cache
429
- secrets=["HF_TOKEN", "H4_TOKEN"], # which secret do I want to copy from the main space? Can be a `List[str]`.
430
- hardware=None, # "cpu-basic" by default. Otherwise set to "auto" to have same hardware as the main space or any valid string value.
431
- storage=None, # no storage by default. Otherwise set to "auto" to have same storage as the main space or any valid string value.
432
- ).launch()
 
2
  import pandas as pd
3
  from apscheduler.schedulers.background import BackgroundScheduler
4
  from huggingface_hub import snapshot_download
5
+ from gradio_space_ci import enable_space_ci
6
 
7
  from src.display.about import (
8
  CITATION_BUTTON_LABEL,
 
37
  create_scores_df,
38
  )
39
 
40
+ # Start ephemeral Spaces on PRs (see config in README.md)
41
+ enable_space_ci()
42
 
43
  def restart_space():
44
  API.restart_space(repo_id=REPO_ID, token=H4_TOKEN)
 
422
  scheduler.add_job(restart_space, "interval", seconds=10800)
423
  scheduler.start()
424
 
425
+ demo.queue(default_concurrency_limit=40).launch()