Jbowyer commited on
Commit
88a9e62
·
verified ·
1 Parent(s): d4dec97

Update gradio_app.py

Browse files

removed zero dependency

Files changed (1) hide show
  1. gradio_app.py +2 -3
gradio_app.py CHANGED
@@ -66,7 +66,6 @@ if ENV == 'Huggingface':
66
  with the specified directory structure.
67
  """
68
  import os, spaces, subprocess, sys, shlex
69
- from spaces import zero
70
 
71
  def prepare_env():
72
  subprocess.run(shlex.split("pip install custom_rasterizer-0.1-cp310-cp310-linux_x86_64.whl"), check=True)
@@ -890,8 +889,8 @@ if __name__ == '__main__':
890
  demo = build_app()
891
  app = gr.mount_gradio_app(app, demo, path="/")
892
 
893
- if ENV == 'Huggingface':
894
- # for Zerogpu
895
  from spaces import zero
896
  zero.startup()
897
 
 
66
  with the specified directory structure.
67
  """
68
  import os, spaces, subprocess, sys, shlex
 
69
 
70
  def prepare_env():
71
  subprocess.run(shlex.split("pip install custom_rasterizer-0.1-cp310-cp310-linux_x86_64.whl"), check=True)
 
889
  demo = build_app()
890
  app = gr.mount_gradio_app(app, demo, path="/")
891
 
892
+ # Only run zero.startup() if in the ZeroGPU environment
893
+ if hasattr(spaces, 'is_zerogpu') and spaces.is_zerogpu():
894
  from spaces import zero
895
  zero.startup()
896