Disable Gradio SSR on Spaces
Browse files
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 |
-
|
|
|
|
| 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()
|