We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d351c99 commit 3d758c1Copy full SHA for 3d758c1
1 file changed
modules/nsf_hifigan/models.py
@@ -23,7 +23,10 @@ def load_model(model_path, device='cuda'):
23
24
generator = Generator(h).to(device)
25
26
- cp_dict = torch.load(model_path)
+ if torch.cuda.is_available():
27
+ cp_dict = torch.load(model_path)
28
+ else:
29
+ cp_dict = torch.load(model_path, map_location="cpu")
30
generator.load_state_dict(cp_dict['generator'])
31
generator.eval()
32
generator.remove_weight_norm()
0 commit comments