Spaces:
Sleeping
Sleeping
Yixuan Li
commited on
Commit
·
2176cd2
1
Parent(s):
9857e4c
forcing torch.load to CPU
Browse files
app.py
CHANGED
|
@@ -9,6 +9,7 @@ device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
|
| 9 |
_old_load = torch.load
|
| 10 |
|
| 11 |
def safe_torch_load(*args, **kwargs):
|
|
|
|
| 12 |
if len(args) >= 2:
|
| 13 |
args[1] = device
|
| 14 |
else:
|
|
|
|
| 9 |
_old_load = torch.load
|
| 10 |
|
| 11 |
def safe_torch_load(*args, **kwargs):
|
| 12 |
+
args = list(args)
|
| 13 |
if len(args) >= 2:
|
| 14 |
args[1] = device
|
| 15 |
else:
|