Spaces:
Sleeping
Sleeping
Create decorators.py
Browse files- decorators.py +11 -0
decorators.py
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# decorators.py
|
2 |
+
|
3 |
+
import spaces
|
4 |
+
|
5 |
+
def gpu_decorator(duration=100):
|
6 |
+
def decorator(func):
|
7 |
+
@spaces.GPU(duration=duration)
|
8 |
+
def wrapper(*args, **kwargs):
|
9 |
+
return func(*args, **kwargs)
|
10 |
+
return wrapper
|
11 |
+
return decorator
|