Download hf_space/gpu_mode.py from UniLat3D/Supra-Tex: direct link, hf CLI and curl.
- Browser
- Download file 498 Bytes
-
https://huggingface.co/spaces/UniLat3D/Supra-Tex/resolve/main/hf_space/gpu_mode.py
- Command line
-
hf download hf://spaces/UniLat3D/Supra-Tex/hf_space/gpu_mode.py
-
curl -L -o gpu_mode.py https://huggingface.co/spaces/UniLat3D/Supra-Tex/resolve/main/hf_space/gpu_mode.py
498 Bytes
| """Hardware mode without importing Torch or starting a GPU runtime.""" | |
| import os | |
| def enabled(): | |
| return os.environ.get('SPACES_ZERO_GPU', '').lower() in ('1', 'true', 't') | |
| def pending_fields(operations): | |
| if not enabled(): | |
| return {} | |
| pending = next((op for op in operations if op.get('status') == 'queued'), None) | |
| return {'gpu_mode': 'zerogpu', 'gpu_operation_id': pending['id'] if pending else None, | |
| 'gpu_operation_kind': pending['kind'] if pending else None} | |