automatic-writing / gpu_runtime.py
jejunepixels's picture
Add Hugging Face login and ZeroGPU generation with real attention
815acd7 verified
Raw History Blame Contribute Delete
302 Bytes
"""ZeroGPU setup must precede model and CUDA imports."""
import spaces
import os
import multiprocessing
ZERO_GPU = os.environ.get("SPACES_ZERO_GPU", "").lower() in ("1", "true")
_MANAGER = multiprocessing.get_context("fork").Manager() if ZERO_GPU else None
def manager():
return _MANAGER