voidful commited on
Commit
740846d
·
verified ·
1 Parent(s): 11a28db

Disable Gradio SSR on Spaces

Browse files
Files changed (1) hide show
  1. app.py +9 -1
app.py CHANGED
@@ -1,5 +1,6 @@
1
  from __future__ import annotations
2
 
 
3
  from pathlib import Path
4
  from typing import Any
5
 
@@ -83,5 +84,12 @@ with gr.Blocks(title="RefCheck") as demo:
83
  )
84
 
85
 
 
 
 
 
 
 
 
86
  if __name__ == "__main__":
87
- demo.queue(default_concurrency_limit=2).launch()
 
1
  from __future__ import annotations
2
 
3
+ import inspect
4
  from pathlib import Path
5
  from typing import Any
6
 
 
84
  )
85
 
86
 
87
+ def launch() -> None:
88
+ launch_kwargs = {}
89
+ if "ssr_mode" in inspect.signature(demo.launch).parameters:
90
+ launch_kwargs["ssr_mode"] = False
91
+ demo.queue(default_concurrency_limit=2).launch(**launch_kwargs)
92
+
93
+
94
  if __name__ == "__main__":
95
+ launch()