Warvito commited on
Commit
df98340
1 Parent(s): 2722e3b

Try to fix device error

Browse files
Files changed (1) hide show
  1. app.py +9 -2
app.py CHANGED
@@ -19,10 +19,17 @@ ffmpeg_path = shutil.which("ffmpeg")
19
  mediapy.set_ffmpeg(ffmpeg_path)
20
 
21
  # Loading model
22
- vqvae = mlflow.pytorch.load_model("./trained_models/vae/")
 
 
 
 
23
  vqvae.eval()
24
 
25
- diffusion = mlflow.pytorch.load_model("./trained_models/ddpm/")
 
 
 
26
  diffusion.eval()
27
 
28
  device = torch.device("cuda")
 
19
  mediapy.set_ffmpeg(ffmpeg_path)
20
 
21
  # Loading model
22
+ device = torch.device("cpu")
23
+ vqvae = mlflow.pytorch.load_model(
24
+ "./trained_models/vae/",
25
+ map_location=device,
26
+ )
27
  vqvae.eval()
28
 
29
+ diffusion = mlflow.pytorch.load_model(
30
+ "./trained_models/ddpm/",
31
+ map_location=device,
32
+ )
33
  diffusion.eval()
34
 
35
  device = torch.device("cuda")