Oysiyl commited on
Commit
4d82052
·
1 Parent(s): 68fe3ae

fix: disable gradio experimental ssr

Browse files
Files changed (2) hide show
  1. app.py +5 -1
  2. tests-unit/test_gradio_launch_config.py +26 -0
app.py CHANGED
@@ -7409,6 +7409,10 @@ if __name__ == "__main__":
7409
  else:
7410
  print("ℹ️ AOT compilation skipped (HF Space / MPS / testing mode)\n")
7411
 
7412
- demo.launch(share=False, mcp_server=True)
 
 
 
 
7413
  # Note: Automatic file cleanup via delete_cache not available in Gradio 5.49.1
7414
  # Files will be cleaned up when the server is restarted
 
7409
  else:
7410
  print("ℹ️ AOT compilation skipped (HF Space / MPS / testing mode)\n")
7411
 
7412
+ demo.launch(
7413
+ share=False,
7414
+ mcp_server=True,
7415
+ ssr_mode=False,
7416
+ )
7417
  # Note: Automatic file cleanup via delete_cache not available in Gradio 5.49.1
7418
  # Files will be cleaned up when the server is restarted
tests-unit/test_gradio_launch_config.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import ast
2
+ from pathlib import Path
3
+
4
+
5
+ APP_PATH = Path(__file__).parents[1] / "app.py"
6
+
7
+
8
+ def test_gradio_launch_disables_experimental_ssr():
9
+ tree = ast.parse(APP_PATH.read_text(encoding="utf-8"))
10
+ launches = [
11
+ node
12
+ for node in ast.walk(tree)
13
+ if isinstance(node, ast.Call)
14
+ and isinstance(node.func, ast.Attribute)
15
+ and node.func.attr == "launch"
16
+ ]
17
+
18
+ assert launches, "app.py must contain a Gradio launch call"
19
+ ssr_values = {
20
+ keyword.value.value
21
+ for launch in launches
22
+ for keyword in launch.keywords
23
+ if keyword.arg == "ssr_mode"
24
+ and isinstance(keyword.value, ast.Constant)
25
+ }
26
+ assert ssr_values == {False}