Spaces:
Running
on
Zero
Running
on
Zero
torch version seems correct but still have gpu error.
Browse files- utils/predict.py +3 -0
utils/predict.py
CHANGED
@@ -1,11 +1,14 @@
|
|
|
|
1 |
try:
|
2 |
import spaces
|
3 |
gpu_decorator = spaces.GPU
|
4 |
from .load_model import load_xclip
|
5 |
except ImportError:
|
|
|
6 |
# Define a no-operation decorator as fallback
|
7 |
def gpu_decorator(func):
|
8 |
return func
|
|
|
9 |
|
10 |
import PIL
|
11 |
import torch
|
|
|
1 |
+
|
2 |
try:
|
3 |
import spaces
|
4 |
gpu_decorator = spaces.GPU
|
5 |
from .load_model import load_xclip
|
6 |
except ImportError:
|
7 |
+
print("No GPU decorator found. Running on CPU.")
|
8 |
# Define a no-operation decorator as fallback
|
9 |
def gpu_decorator(func):
|
10 |
return func
|
11 |
+
|
12 |
|
13 |
import PIL
|
14 |
import torch
|