fazrigading commited on
Commit
f5f1c06
·
verified ·
1 Parent(s): 3cd7d26

add ZeroGPU warmup function

Browse files
Files changed (1) hide show
  1. app.py +9 -0
app.py CHANGED
@@ -4,6 +4,15 @@ import sys
4
  sys.path.insert(0, os.path.join(os.path.dirname(__file__), "src"))
5
  sys.path.insert(0, os.path.dirname(__file__))
6
 
 
 
 
 
 
 
 
 
 
7
  from roicropper.web import demo, launch
8
 
9
  if __name__ == "__main__":
 
4
  sys.path.insert(0, os.path.join(os.path.dirname(__file__), "src"))
5
  sys.path.insert(0, os.path.dirname(__file__))
6
 
7
+ try:
8
+ import spaces
9
+
10
+ @spaces.GPU
11
+ def _roicropper_gpu_warmup():
12
+ return None
13
+ except ImportError:
14
+ pass
15
+
16
  from roicropper.web import demo, launch
17
 
18
  if __name__ == "__main__":