Spaces:
Running on Zero
Running on Zero
Download backend/app/gpu.py from projectxddi/be_protein_binding: direct link, hf CLI and curl.
- Browser
- Download file 338 Bytes
-
https://huggingface.co/spaces/projectxddi/be_protein_binding/resolve/main/backend/app/gpu.py
- Command line
-
hf download hf://spaces/projectxddi/be_protein_binding/backend/app/gpu.py
-
curl -L -o gpu.py https://huggingface.co/spaces/projectxddi/be_protein_binding/resolve/main/backend/app/gpu.py
338 Bytes
| """One lock for all GPU work of this process (local ESMFold, ESM-2, ProtT5, the checkpoints). | |
| Requests are served from a thread pool; serialising GPU work keeps memory bounded on one GPU and lets local | |
| ESMFold switch TF32 on for its own forward pass without affecting the other models. | |
| """ | |
| import threading | |
| GPU_LOCK = threading.RLock() | |