Fabrice-TIERCELIN commited on
Commit
c8c178a
·
verified ·
1 Parent(s): 085ace4

Ease the run on local

Browse files
Files changed (1) hide show
  1. infer.py +9 -1
infer.py CHANGED
@@ -6,7 +6,15 @@ import tempfile
6
  import numpy as np
7
  import tqdm
8
  import ffmpeg
9
- import spaces
 
 
 
 
 
 
 
 
10
 
11
 
12
  device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
 
6
  import numpy as np
7
  import tqdm
8
  import ffmpeg
9
+
10
+ try:
11
+ import spaces
12
+ except:
13
+ class spaces():
14
+ def GPU(*args, **kwargs):
15
+ def decorator(function):
16
+ return lambda *dummy_args, **dummy_kwargs: function(*dummy_args, **dummy_kwargs)
17
+ return decorator
18
 
19
 
20
  device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')