Biotech2 / decorators.py
C2MV's picture
Update decorators.py
c4944bf verified
raw
history blame
310 Bytes
# decorators.py
import spaces
# Decorador personalizado que usa GPU si está disponible
def gpu_decorator(duration=100):
def decorator(func):
@spaces.GPU(duration=duration)
def wrapper(*args, **kwargs):
return func(*args, **kwargs)
return wrapper
return decorator