m7n commited on
Commit
7905812
·
verified ·
1 Parent(s): 4f1d82c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -35,7 +35,7 @@ def process_text(text):
35
  time.sleep(10)
36
 
37
  return text.upper()
38
-
39
 
40
  def process_and_save(request: gr.Request, text):
41
  """Main processing function that handles tokens and calls GPU function"""
@@ -74,10 +74,10 @@ with gr.Blocks() as demo:
74
  )
75
 
76
  # Mount Gradio app to FastAPI with SSR mode for Spaces
77
- app = gr.mount_gradio_app(app, demo, path="/", ssr_mode=False)
78
 
79
  # Run server
80
  if __name__ == "__main__":
81
  # Set SSR mode for Spaces
82
- os.environ["GRADIO_SSR_MODE"] = "False"
83
  uvicorn.run(app, host="0.0.0.0", port=7860)
 
35
  time.sleep(10)
36
 
37
  return text.upper()
38
+ # I've tried also wrapping the immediate function called by gradio, and the zerogpu = True trick
39
 
40
  def process_and_save(request: gr.Request, text):
41
  """Main processing function that handles tokens and calls GPU function"""
 
74
  )
75
 
76
  # Mount Gradio app to FastAPI with SSR mode for Spaces
77
+ app = gr.mount_gradio_app(app, demo, path="/", ssr_mode=True)
78
 
79
  # Run server
80
  if __name__ == "__main__":
81
  # Set SSR mode for Spaces
82
+ os.environ["GRADIO_SSR_MODE"] = "True"
83
  uvicorn.run(app, host="0.0.0.0", port=7860)