realphongha commited on
Commit
1ae40eb
·
1 Parent(s): 3244843

fix app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -17,6 +17,10 @@ import tempfile
17
  import time
18
  from pathlib import Path
19
 
 
 
 
 
20
  import gradio as gr
21
  import numpy as np
22
  from PIL import Image
@@ -612,7 +616,7 @@ def main():
612
  port_str = os.environ.get("GRADIO_SERVER_PORT") or os.environ.get("PORT")
613
  port = int(port_str) if port_str else None
614
 
615
- app.launch(server_name=host, server_port=port)
616
 
617
 
618
  if __name__ == "__main__":
 
17
  import time
18
  from pathlib import Path
19
 
20
+ try:
21
+ import spaces
22
+ except ImportError:
23
+ pass
24
  import gradio as gr
25
  import numpy as np
26
  from PIL import Image
 
616
  port_str = os.environ.get("GRADIO_SERVER_PORT") or os.environ.get("PORT")
617
  port = int(port_str) if port_str else None
618
 
619
+ app.launch(server_name=host, server_port=port, ssr_mode=False)
620
 
621
 
622
  if __name__ == "__main__":