Spaces:
Paused
Paused
Commit History
-
Fix string formatting in Blender script template
Verified signature- Changed f-strings to string concatenation in GPU config section - Fixes KeyError: 'compute_device_type' in .format() call - Aligns with demo.zip coding style (string concatenation, not f-strings) - Lines 374, 382, 384: Removed f-string syntax to avoid format() conflicts6f98a55 -
Match demo.zip render settings: enable GPU rendering with 512 samples
Verified signature- Changed samples from 64 to 512 for higher quality (matching demo.zip) - Changed device from forced CPU to GPU-first with CPU fallback - Added comprehensive GPU detection logic (NVIDIA/Apple/AMD) - Implements automatic CPU fallback if GPU unavailable - Fully complies with demo.zip rendering specifications9caea3a
-
Fix: Remove use_safetensors=True for CLIP model loading
Verified signatureRoot cause (Research findings): - openai/clip-vit-base-patch32 main branch only has pytorch_model.bin - model.safetensors exists in PR #21 (revision d15b5f2) but NOT merged to main - Code forced use_safetensors=True → file not found → runtime failure - Working version (commit b9fd613) did NOT have this flag Solution: - Remove use_safetensors=True from CLIPModel.from_pretrained (line 144) - Remove use_safetensors=True from CLIPProcessor.from_pretrained (line 155) - Let transformers auto-detect available weight files (pytorch_model.bin) - Add documentation explaining why we use pytorch_model.bin Security considerations (CVE-2025-32434): - Using official OpenAI model (high trust, low risk) - local_files_only=True prevents malicious replacements - Model preloaded during build in controlled environment - Same approach as working version b9fd613 Official documentation: - CLIP model files: https://huggingface.co/openai/clip-vit-base-patch32/tree/main - Safetensors PR: https://huggingface.c…edbbf00 -
Fix: Align cache path with preload_from_hub behavior
Verified signatureRoot cause (Git history analysis): - preload_from_hub ALWAYS downloads to ~/.cache/huggingface/hub/ (hardcoded by HF Spaces) - config.py was using HF_HOME env var → ~/.cache/huggingface (missing /hub suffix) - Result: transformers looked in ~/.cache/huggingface/models--* but files were in ~/.cache/huggingface/hub/models--* Solution: - config.py now uses HF_HUB_CACHE environment variable - HF_HUB_CACHE is set in README.md to /home/user/.cache/huggingface/hub - This matches exactly where preload_from_hub downloads models - Simplified logic: removed complex fallback, direct path alignment Official documentation: "Files are saved in the default huggingface_hub disk cache ~/.cache/huggingface/hub. If your application expects them elsewhere or you changed your HF_HOME variable, this pre-loading does not follow that at this time." Source: https://huggingface.co/docs/hub/spaces-config-reference Changes: - code/cube3d/config.py lines 61-83: Use HF_HUB_CACHE instead of HF_HOME - Removed com…c811f2f -
Fix startup hang: 使用 local_files_only=True
Verified signature5cea805 -
Fix startup hang: 使用 local_files_only=True
Verified signature657e4d3 -
Update code/demo.py: 主程序(支持Model Hub权重加载)
Verified signature9fa6864
-
Fix: Match demo.zip checkpoint loading logic exactly - all 3 paths point to same existing file
Verified signature3db6945 -
Fix: Remove engine caching to prevent LDR generation state corruption
Verified signature1c8c926 -
Fix: Force EngineFast for GPU T4 small environment
Verified signature- Remove CPU fallback logic (not needed on GPU tier) - Force use of EngineFast which has t2t() method - Resolves AttributeError: 'Engine' object has no attribute 't2t' Requirements: HF Space must use GPU hardware (T4 small or better)f17371f -
Fix: Safe device selection for CPU/GPU compatibility
Verified signature- clip_retrieval.py: Add _resolve_device() with CUDA detection & CPU fallback - demo.py: Auto-select GPT engine (EngineFast for CUDA, Engine for CPU) - engine.py: Normalize device_map to string for CLIP text encoder Resolves: CUDA availability issues on HF Spaces CPU instances Support: Works on both GPU and CPU tiers File: code/cube3d/training/engine.py4885d4a -
Fix: Safe device selection for CPU/GPU compatibility
Verified signature- clip_retrieval.py: Add _resolve_device() with CUDA detection & CPU fallback - demo.py: Auto-select GPT engine (EngineFast for CUDA, Engine for CPU) - engine.py: Normalize device_map to string for CLIP text encoder Resolves: CUDA availability issues on HF Spaces CPU instances Support: Works on both GPU and CPU tiers File: code/demo.py06cb17d -
Fix: Safe device selection for CPU/GPU compatibility
Verified signature- clip_retrieval.py: Add _resolve_device() with CUDA detection & CPU fallback - demo.py: Auto-select GPT engine (EngineFast for CUDA, Engine for CPU) - engine.py: Normalize device_map to string for CLIP text encoder Resolves: CUDA availability issues on HF Spaces CPU instances Support: Works on both GPU and CPU tiers File: code/clip_retrieval.py8526d06 -
Fix: Robust HF cache directory with graceful /data fallback
Verified signature- Handle PermissionError when /data is not accessible - Auto-fallback: /data/.huggingface → /home/user/.cache - Add write permission verification - Support both paid tier and free tier Resolves: PermissionError [Errno 13] Permission denied: '/data'5cb5de0
-
Fix: Gradio UI image display for text-to-LEGO generation
Verified signatureProblem: Rendered LEGO images weren't showing after successful rendering Root cause: Return value mismatch between unified_input_handler() and Gradio outputs Changes: - unified_input_handler() now returns 6 values (was 5) - Added LDR text output as 5th return value - Added rendered_image as 6th return value - Updated Gradio output mapping to include render_result (Image component) Affected functions: - unified_input_handler(): Returns (renderings, part_list, status, ldr_data, ldr_text, rendered_image) - process_ldr_file(): Returns (..., None, None) for file upload flow - process_ldr_from_path(): Returns (..., None, None) for path-based flow UI Flow: 1. User enters "red car" → CLIP retrieval → GPT generation → Blender render 2. Image now displays correctly in "Rendering Result" section 3. LDR text displays in "Generated LDR Content" textbox This completes the text-to-LEGO visualization pipeline.8a553ca
-
Fix: Gradio UI image display for text-to-LEGO generation
Verified signatureProblem: Rendered LEGO images weren't showing after successful rendering Root cause: Return value mismatch between unified_input_handler() and Gradio outputs Changes: - unified_input_handler() now returns 6 values (was 5) - Added LDR text output as 5th return value - Added rendered_image as 6th return value - Updated Gradio output mapping to include render_result (Image component) Affected functions: - unified_input_handler(): Returns (renderings, part_list, status, ldr_data, ldr_text, rendered_image) - process_ldr_file(): Returns (..., None, None) for file upload flow - process_ldr_from_path(): Returns (..., None, None) for path-based flow UI Flow: 1. User enters "red car" → CLIP retrieval → GPT generation → Blender render 2. Image now displays correctly in "Rendering Result" section 3. LDR text displays in "Generated LDR Content" textbox This completes the text-to-LEGO visualization pipeline.f2a0d96 -
Fix: Disable denoising for apt-get Blender (no OpenImageDenoise)
Verified signatureBlender 4.3.2 installed via apt-get lacks OpenImageDenoise support. Explicitly disable denoising to prevent render failures. This fix adds: - bpy.context.view_layer.cycles.use_denoising = False - Informative log message Quality impact: Minor noise at 64 samples, acceptable for LEGO previews.e5385f9 -
Upload folder using huggingface_hub
Verified signature0493475 -
Upload code/ImportLDraw/loadldraw/loadldraw.py with huggingface_hub
Verified signature22bb3de -
Upload code/ImportLDraw/loadldraw/loadldraw.py with huggingface_hub
Verified signature898920f -
Upload code/cube3d/render/render_bricks_safe.py with huggingface_hub
Verified signaturefcebf9d -
Upload code/cube3d/render/render_bricks_safe.py with huggingface_hub
Verified signature18bcb1f -
Fix: Use ImportLDraw operator instead of direct loadFromFile() call (best practice)
Verified signature8567a26 -
Fix: Replace f-string with string concatenation to avoid .format() conflict
Verified signaturecf922a5 -
Fix: Create MockOperator class to provide report() method for ImportLDraw
Verified signature16f9e70 -
Fix: Use bpy.context instead of None in loadFromFile call
Verified signaturebec2965
-
Upload code/cube3d/render/render_bricks_safe.py with huggingface_hub
Verified signature64f982b -
Upload code/cube3d/render/render_bricks.py with huggingface_hub
Verified signaturecad0c51 -
Upload code/cube3d/render/render_bricks_safe.py with huggingface_hub
Verified signature8e335ab -
Upload code/cube3d/render/render_bricks_safe.py with huggingface_hub
Verified signaturef1e112b -
Upload code/cube3d/render/render_bricks_safe.py with huggingface_hub
Verified signaturef5175a7 -
Upload code/cube3d/render/render_bricks_safe.py with huggingface_hub
Verified signature25d2ec9 -
Upload code/demo.py with huggingface_hub
Verified signature0d1f955 -
Fix: Add missing out_file parameter to render_bricks_safe() in CLIP flow
Verified signature- Fixed TypeError in CLIP text-to-ldr rendering (line 290) - Added render_path creation before calling render_bricks_safe() - Now matches original demo's calling pattern (line 399-402) - Original file upload flow unchanged and still correct - Bug was introduced when adding CLIP feature, not in original demo.zip5560e08 -
Fix: Add embedder key remapping for backward compatibility
Verified signature- Modified load_model_weights to handle old checkpoint format - Old format: embedder.weight - New format: encoder.embedder.weight + occupancy_decoder.embedder.weight - Checkpoint is loaded as dict first, keys are remapped, then loaded to model - This fixes the AssertionError on HuggingFace Space deployment - Maintains backward compatibility with both checkpoint formatsdaa3ea5
-
Fix: Restore demo.py to use correct config file (open_model_v0.5.yaml)
Verified signature- Changed config_path from open_model.yaml back to open_model_v0.5.yaml - open_model_v0.5.yaml is the validated production config (5-layer GPT) - Fixes dimension mismatch error (ldr_proj 959 vs 2048) - This matches the original demo configurationf1260ee
-
Upload code/cube3d/configs/open_model.yaml with huggingface_hub
Verified signature8c9797f -
Fix: Add missing open_model.yaml config file
Verified signatureThis file is required by the GPT model architecture fix. Contains configuration for 23-layer model matching the checkpoint.a9218db -
Fix: Use correct GPT model config (open_model.yaml)
Verified signatureChanges config from open_model_v0.5.yaml to open_model.yaml to match the actual checkpoint architecture (23 layers, no embedder layers). This resolves the AssertionError caused by config/checkpoint version mismatch.005c492 -
Debug: Add comprehensive diagnostic logging to trace label mapping issue
Verified signature7069bb9 -
Add diagnostic logging for label mapping file loading
Verified signature9c92c05 -
Add diagnostic logging for label mapping file loading
Verified signature01f651c -
Fix: Use absolute config path for HuggingFace Spaces deployment
Verified signatureROOT CAUSE: - demo.py line 59 used relative path: 'cube3d/configs/open_model_v0.5.yaml' - In HF Spaces, working directory is /home/user/app/ (project root) - Code files are in /home/user/app/code/ - Relative path resolved to: /home/user/app/cube3d/configs/... (WRONG) - Correct path should be: /home/user/app/code/cube3d/configs/... (CORRECT) ERROR MESSAGE: FileNotFoundError: [Errno 2] No such file or directory: '/home/user/app/cube3d/configs/open_model_v0.5.yaml' SOLUTION: - Changed config_path from relative to absolute path using os.path.dirname(__file__) - Now resolves correctly regardless of working directory - Compatible with both local development and HF Spaces deployment CHANGES: - code/demo.py line 59-60: OLD: config_path = 'cube3d/configs/open_model_v0.5.yaml' NEW: config_path = os.path.join(os.path.dirname(__file__), 'cube3d/configs/open_model_v0.5.yaml') EXPECTED BEHAVIOR: - Config file loads successfully - GPT engine initializes without errors - "Generate New LDR & R…76d6193
-
Fix: Force safetensors loading to bypass CVE-2025-32434 (CRITICAL SECURITY)
Verified signatureROOT CAUSE: - CVE-2025-32434: Critical RCE vulnerability in PyTorch < 2.6 (CVSS 9.3/10) - Transformers library (4.48+) blocks loading .bin files with torch < 2.6 - Current torch version: 2.1.0-2.3.0 (below minimum safe version 2.6.0) - CLIP model downloads BOTH pytorch_model.bin and model.safetensors - Default behavior tries to load pytorch_model.bin → Security check fails ERROR MESSAGE: "Due to a serious vulnerability issue in `torch.load`, even with `weights_only=True`, we now require users to upgrade torch to at least v2.6 in order to use the function. This version restriction does not apply when loading files with safetensors." SOLUTION: - Add use_safetensors=True parameter to force safetensors loading - Bypasses torch version requirement (safetensors format is secure) - Uses already-downloaded model.safetensors (605MB, no re-download) - No torch upgrade needed (avoids breaking other dependencies) SECURITY BENEFITS: - Safetensors format has no pickle deserialization (inherent…9ec1c8c -
Fix: Remove preload_from_hub to resolve XET permission errors (CRITICAL)
Verified signatureROOT CAUSE (from official HuggingFace documentation): - preload_from_hub downloads models to ~/.cache/huggingface/hub (default) - Custom HF_HOME=/data/.huggingface causes cache location mismatch - Code looks for models in /data but finds them in ~/.cache - Triggers re-download attempt using XET backend - XET tries to write to ~/.cache/huggingface/xet (read-only) → Permission denied OFFICIAL DOCUMENTATION QUOTE: "Files are saved in the default huggingface_hub disk cache ~/.cache/huggingface/hub. If your application expects them elsewhere or you changed your HF_HOME variable, this pre-loading does not follow that at this time." SOLUTION: 1. Remove preload_from_hub configuration (incompatible with custom cache) 2. Add explicit cache environment variables with correct precedence: - HF_HUB_CACHE: /data/.huggingface/hub (highest priority) - TRANSFORMERS_CACHE: /data/.huggingface/transformers - HF_HOME: /data/.huggingface (base directory) 3. Allow runtime model downloads (local_fil…b501d11 -
Update code/demo.py
Verified signature2c355ab -
Fix CLIP loading: Use /data cache for clip_retrieval.py
Verified signature5b6a559 -
Fix CLIP loading: Use /data cache for config.py
Verified signature7a4cc65 -
Add code/cube3d/model/transformers/rope.py
Verified signaturee79b1e4 -
Add code/cube3d/model/transformers/__init__.py
Verified signature49b5170