Spaces:
Runtime error
Runtime error
Disable ZeroGPU and use persistent GPU hardware
Browse filesZeroGPU's offloading mechanism is incompatible with Hunyuan3D's
large models, causing FileNotFoundError in zerogpu-offload directory.
Changes:
- Commented out all @spaces.GPU decorators
- Disabled zero.startup() call
- Use args.device (cuda) directly instead of CPU
- Removed spaces library from requirements.txt
- Changed suggested_hardware from a100-large to a10g-large
This requires persistent GPU hardware (paid tier) but will work reliably.
User needs to upgrade Space to paid GPU tier in HuggingFace settings.
- README.md +1 -1
- gradio_app.py +15 -11
- requirements.txt +1 -1
README.md
CHANGED
|
@@ -7,7 +7,7 @@ sdk: gradio
|
|
| 7 |
sdk_version: 5.33.0
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
-
suggested_hardware:
|
| 11 |
license: other
|
| 12 |
tags:
|
| 13 |
- 3D
|
|
|
|
| 7 |
sdk_version: 5.33.0
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
+
suggested_hardware: a10g-large
|
| 11 |
license: other
|
| 12 |
tags:
|
| 13 |
- 3D
|
gradio_app.py
CHANGED
|
@@ -269,7 +269,8 @@ height="{height}" width="100%" frameborder="0"></iframe>'
|
|
| 269 |
</div>
|
| 270 |
"""
|
| 271 |
|
| 272 |
-
|
|
|
|
| 273 |
def _gen_shape(
|
| 274 |
caption=None,
|
| 275 |
image=None,
|
|
@@ -378,7 +379,8 @@ def _gen_shape(
|
|
| 378 |
main_image = image if not MV_MODE else image['front']
|
| 379 |
return mesh, main_image, save_folder, stats, seed
|
| 380 |
|
| 381 |
-
|
|
|
|
| 382 |
def generation_all(
|
| 383 |
caption=None,
|
| 384 |
image=None,
|
|
@@ -460,7 +462,8 @@ def generation_all(
|
|
| 460 |
seed,
|
| 461 |
)
|
| 462 |
|
| 463 |
-
|
|
|
|
| 464 |
def shape_generation(
|
| 465 |
caption=None,
|
| 466 |
image=None,
|
|
@@ -886,16 +889,17 @@ if __name__ == '__main__':
|
|
| 886 |
from hy3dshape.pipelines import export_to_trimesh
|
| 887 |
from hy3dshape.rembg import BackgroundRemover
|
| 888 |
|
| 889 |
-
#
|
| 890 |
-
if ENV == 'Huggingface':
|
| 891 |
-
|
| 892 |
-
|
| 893 |
|
| 894 |
rmbg_worker = BackgroundRemover()
|
| 895 |
-
|
| 896 |
-
#
|
| 897 |
-
model_device = 'cpu' if ENV == 'Huggingface' else args.device
|
| 898 |
-
|
|
|
|
| 899 |
i23d_worker = Hunyuan3DDiTFlowMatchingPipeline.from_pretrained(
|
| 900 |
args.model_path,
|
| 901 |
subfolder=args.subfolder,
|
|
|
|
| 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 |
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 |
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,
|
|
|
|
| 889 |
from hy3dshape.pipelines import export_to_trimesh
|
| 890 |
from hy3dshape.rembg import BackgroundRemover
|
| 891 |
|
| 892 |
+
# ZeroGPU disabled due to offloading errors - using persistent GPU instead
|
| 893 |
+
# if ENV == 'Huggingface':
|
| 894 |
+
# from spaces import zero
|
| 895 |
+
# zero.startup()
|
| 896 |
|
| 897 |
rmbg_worker = BackgroundRemover()
|
| 898 |
+
|
| 899 |
+
# Use CUDA directly for persistent GPU (ZeroGPU disabled)
|
| 900 |
+
# model_device = 'cpu' if ENV == 'Huggingface' else args.device
|
| 901 |
+
model_device = args.device
|
| 902 |
+
|
| 903 |
i23d_worker = Hunyuan3DDiTFlowMatchingPipeline.from_pretrained(
|
| 904 |
args.model_path,
|
| 905 |
subfolder=args.subfolder,
|
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
|
| 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 # Disabled: ZeroGPU causes offloading errors with large models
|
| 9 |
|
| 10 |
# Build Tools
|
| 11 |
ninja==1.11.1.1
|