HongzeFu commited on
Commit
c97acd8
·
1 Parent(s): 179063c

app.py for hf-space

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -52,6 +52,7 @@ def build_allowed_paths() -> list[str]:
52
 
53
 
54
  _APP_BOOTSTRAPPED = False
 
55
 
56
 
57
  def bootstrap_runtime() -> None:
@@ -66,12 +67,15 @@ def bootstrap_runtime() -> None:
66
  _APP_BOOTSTRAPPED = True
67
 
68
 
69
- bootstrap_runtime()
70
  demo = create_ui_blocks()
71
- demo.queue(default_concurrency_limit=2)
72
 
73
 
74
  def main() -> None:
 
 
 
 
 
75
  allowed_paths = build_allowed_paths()
76
  demo.launch(
77
  server_name="0.0.0.0",
 
52
 
53
 
54
  _APP_BOOTSTRAPPED = False
55
+ _DEMO_QUEUED = False
56
 
57
 
58
  def bootstrap_runtime() -> None:
 
67
  _APP_BOOTSTRAPPED = True
68
 
69
 
 
70
  demo = create_ui_blocks()
 
71
 
72
 
73
  def main() -> None:
74
+ global _DEMO_QUEUED
75
+ bootstrap_runtime()
76
+ if not _DEMO_QUEUED:
77
+ demo.queue(default_concurrency_limit=2)
78
+ _DEMO_QUEUED = True
79
  allowed_paths = build_allowed_paths()
80
  demo.launch(
81
  server_name="0.0.0.0",