eloigil6 Claude Opus 4.8 commited on
Commit
53feffb
·
1 Parent(s): 3ae6607

Fix ZeroGPU detection: read spaces Config.zero_gpu, not exact env match

Browse files

The previous check compared SPACES_ZERO_GPU to the literal "true", but the ZeroGPU runtime sets a value the spaces library parses loosely ("1"/"t"/"true"), so IS_ZEROGPU was False on the Space and generation fell back to CPU (loaded lazily on cpu mid-brew). Read the library's own Config.zero_gpu - the same flag that gates the @spaces.GPU decorator - so detection is True exactly when a GPU will be allocated. Add a startup log of the resolved flag for diagnosis.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

1 file changed +19 -3
app.py+19-3