NeAR CPU preload via hdri_encoder.py hack broke ZeroGPU again.
Revert to the working pattern:
- hdri_encoder.py: restore convnext_tiny(weights=ConvNeXt_Tiny_Weights...)
- app.py: do NOT preload NeAR in main process (snapshot_download only)
UI title, frame defaults, and split videos/glb architecture are kept.
fix: enable NeAR CPU preload by bypassing torchvision weights CUDA init
- hdri_encoder.py: replace torchvision.convnext_tiny(weights=...) with
weights=None + manual torch.load(map_location='cpu', weights_only=True).
torchvision's weights enum triggered torch._C._cuda_init even when the
checkpoint was already cached, breaking ZeroGPU's main-process isolation.
- app.py: re-enable NeAR CPU preload in _preload_worker. With convnext
fixed, NeAR can safely load in the background thread like Hunyuan3D,
eliminating the ~25s from_pretrained penalty on every @GPU click.
fix(spaces): Hdri torch.load after ConvNeXt; default off CPU preload with spaces
- hdri_encoder: torch.load(..., weights_only=False, map_location=cpu) so Stateless
GPU WeightsUnpickler does not run after torchvision may have touched CUDA
- app: default NEAR_MODEL_CPU_PRELOAD_AT_START=0 when spaces is installed
- test: assert Hdri load_weights uses full unpickle on CPU
Made-with: Cursor
fix(load): CPU-only checkpoint load for ZeroGPU main process
- trellis from_pretrained: always map_location=cpu, avoid torch.cuda probe
- clear_session_dir: drop cuda empty_cache on main process
- test: assert from_pretrained stays CPU-safe for HF Stateless GPU
Made-with: Cursor
restore: full Space tree + assets (recover from minimal force-push); keep ZeroGPU app.py
- Sync from hf-near mirror for trellis, hy3dshape, assets (LFS), etc.
- README: python_version + quoted short_description for Hub YAML
- requirements: spaces, gradio[oauth,mcp], kaolin find-links; drop --no-build-isolation line for Gradio builder
Made-with: Cursor