raylim commited on
Commit
d69d3b8
·
unverified ·
1 Parent(s): 67d8e2d

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

Files changed (1) hide show
  1. 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
- # The ZERO_GPU env var is set when running on ZeroGPU
16
- IS_ZEROGPU = os.environ.get("ZERO_GPU") == "true"
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