Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -152,6 +152,8 @@ def scale_box(box, scale):
|
|
| 152 |
|
| 153 |
@spaces.GPU
|
| 154 |
def generate_sgg(image):
|
|
|
|
|
|
|
| 155 |
device='cuda' if torch.cuda.is_available() else "cpu"
|
| 156 |
if next(model.parameters()).device != torch.device(device):
|
| 157 |
model = model.to(device)
|
|
|
|
| 152 |
|
| 153 |
@spaces.GPU
|
| 154 |
def generate_sgg(image):
|
| 155 |
+
global model
|
| 156 |
+
|
| 157 |
device='cuda' if torch.cuda.is_available() else "cpu"
|
| 158 |
if next(model.parameters()).device != torch.device(device):
|
| 159 |
model = model.to(device)
|