Spaces:
Sleeping
Sleeping
Fix ZeroGPU detection to use correct env var
Browse files- Change from ZERO_GPU=true to SPACES_ZERO_GPU=1
- This is the actual environment variable set by HF Spaces
- Now num_workers will correctly be set to 0 on ZeroGPU
- Also enables batch_size=128 optimization for H100
- src/mosaic/analysis.py +2 -2
src/mosaic/analysis.py
CHANGED
|
@@ -12,8 +12,8 @@ try:
|
|
| 12 |
|
| 13 |
HAS_SPACES = True
|
| 14 |
# Check if we're actually running on ZeroGPU
|
| 15 |
-
#
|
| 16 |
-
IS_ZEROGPU = os.environ.get("
|
| 17 |
except ImportError:
|
| 18 |
HAS_SPACES = False
|
| 19 |
IS_ZEROGPU = False
|
|
|
|
| 12 |
|
| 13 |
HAS_SPACES = True
|
| 14 |
# Check if we're actually running on ZeroGPU
|
| 15 |
+
# HF Spaces sets SPACES_ZERO_GPU=1 when using ZeroGPU
|
| 16 |
+
IS_ZEROGPU = os.environ.get("SPACES_ZERO_GPU") == "1"
|
| 17 |
except ImportError:
|
| 18 |
HAS_SPACES = False
|
| 19 |
IS_ZEROGPU = False
|