minhho commited on
Commit
60fde33
Β·
1 Parent(s): 77d72f8

Re-enable @spaces.GPU decorators for persistent GPU

Browse files

HuggingFace Spaces requires @spaces.GPU decorators even with
persistent GPU hardware, but we should NOT call zero.startup().

Changes:
- Re-enabled @spaces.GPU decorators on all three functions
- Added back spaces>=0.28.3 to requirements.txt
- Kept zero.startup() commented out (critical for persistent GPU)
- Models still load on CUDA (args.device), not CPU

This allows persistent GPU to work without ZeroGPU offloading errors.

Files changed (2) hide show
  1. gradio_app.py +3 -6
  2. requirements.txt +1 -1
gradio_app.py CHANGED
@@ -269,8 +269,7 @@ height="{height}" width="100%" frameborder="0"></iframe>'
269
  </div>
270
  """
271
 
272
- # Disabled ZeroGPU due to offloading errors with large models
273
- # @spaces.GPU(duration=60)
274
  def _gen_shape(
275
  caption=None,
276
  image=None,
@@ -379,8 +378,7 @@ def _gen_shape(
379
  main_image = image if not MV_MODE else image['front']
380
  return mesh, main_image, save_folder, stats, seed
381
 
382
- # Disabled ZeroGPU due to offloading errors with large models
383
- # @spaces.GPU(duration=180)
384
  def generation_all(
385
  caption=None,
386
  image=None,
@@ -462,8 +460,7 @@ def generation_all(
462
  seed,
463
  )
464
 
465
- # Disabled ZeroGPU due to offloading errors with large models
466
- # @spaces.GPU(duration=60)
467
  def shape_generation(
468
  caption=None,
469
  image=None,
 
269
  </div>
270
  """
271
 
272
+ @spaces.GPU(duration=60)
 
273
  def _gen_shape(
274
  caption=None,
275
  image=None,
 
378
  main_image = image if not MV_MODE else image['front']
379
  return mesh, main_image, save_folder, stats, seed
380
 
381
+ @spaces.GPU(duration=180)
 
382
  def generation_all(
383
  caption=None,
384
  image=None,
 
460
  seed,
461
  )
462
 
463
+ @spaces.GPU(duration=60)
 
464
  def shape_generation(
465
  caption=None,
466
  image=None,
requirements.txt CHANGED
@@ -5,7 +5,7 @@
5
  --extra-index-url https://download.blender.org/pypi/
6
 
7
  # Hugging Face Spaces Support
8
- # spaces>=0.28.3 # Disabled: ZeroGPU causes offloading errors with large models
9
 
10
  # Build Tools
11
  ninja==1.11.1.1
 
5
  --extra-index-url https://download.blender.org/pypi/
6
 
7
  # Hugging Face Spaces Support
8
+ spaces>=0.28.3 # Required for @spaces.GPU decorators on persistent GPU
9
 
10
  # Build Tools
11
  ninja==1.11.1.1