Spaces:
Runtime error
Runtime error
| import os | |
| import sys | |
| # Configure VTK for headless rendering BEFORE any VTK imports | |
| if os.environ.get("PORT") or os.environ.get("HF_PORT") or os.environ.get("SPACE_ID"): | |
| os.environ["MESA_GL_VERSION_OVERRIDE"] = "3.2" | |
| os.environ["MESA_GLSL_VERSION_OVERRIDE"] = "150" | |
| os.environ["GALLIUM_DRIVER"] = "llvmpipe" | |
| # Force VTK to use OSMesa for offscreen rendering | |
| os.environ["VTK_DEFAULT_EGL_DEVICE_INDEX"] = "-1" | |
| # ...existing imports... | |