Spaces:
Running on Zero
Running on Zero
File size: 344 Bytes
9d24374 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | from __future__ import annotations
try:
import spaces # type: ignore
except ImportError: # Local development and unit tests.
spaces = None
def gpu(duration: int = 60):
if spaces is not None and hasattr(spaces, "GPU"):
return spaces.GPU(duration=duration)
def decorator(fn):
return fn
return decorator
|