doevent commited on
Commit
112171d
1 Parent(s): 566acd1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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="cuda",
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