C2MV commited on
Commit
209bb28
1 Parent(s): 613b36f

Create decorators.py

Browse files
Files changed (1) hide show
  1. 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