Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -10,14 +10,14 @@ from PIL import Image
|
|
10 |
from torchvision.transforms.functional import center_crop, to_tensor
|
11 |
|
12 |
|
13 |
-
|
14 |
|
15 |
print("🧠 Loading Model...")
|
16 |
model = torch.hub.load(
|
17 |
"AK391/animegan2-pytorch:main",
|
18 |
"generator",
|
19 |
pretrained=True,
|
20 |
-
device=
|
21 |
progress=True,
|
22 |
)
|
23 |
|
|
|
10 |
from torchvision.transforms.functional import center_crop, to_tensor
|
11 |
|
12 |
|
13 |
+
device = "cuda" if torch.cuda.is_available() else "cpu"
|
14 |
|
15 |
print("🧠 Loading Model...")
|
16 |
model = torch.hub.load(
|
17 |
"AK391/animegan2-pytorch:main",
|
18 |
"generator",
|
19 |
pretrained=True,
|
20 |
+
device=device,
|
21 |
progress=True,
|
22 |
)
|
23 |
|