SefyanKehail commited on
Commit
aecdaa7
·
1 Parent(s): b73bd96

debugging..

Browse files
Files changed (1) hide show
  1. app.py +9 -9
app.py CHANGED
@@ -18,21 +18,21 @@ def get_file_size_in_mb(file_path):
18
 
19
 
20
  # Load the models using torch.hub
21
- # hubert = torch.hub.load("bshall/hubert:main", "hubert_soft", trust_repo=True)
22
- # acoustic = torch.hub.load("bshall/acoustic-model:main", "hubert_soft", trust_repo=True, pretrained=False)
23
- # hifigan = torch.hub.load("bshall/hifigan:main", "hifigan_hubert_soft", trust_repo=True, pretrained=False)
24
 
25
 
26
  # Load the state dictionaries from the CPU-saved files
27
- hubert = torch.load("hubert_cpu.pt", map_location=torch.device('cpu'))
28
- acoustic = torch.load("acoustic_cpu.pt", map_location=torch.device('cpu'))
29
- hifigan = torch.load("hifigan_cpu.pt", map_location=torch.device('cpu'))
30
 
31
 
32
  # Set the state dictionaries to the models
33
- # hubert.load_state_dict(hubert_state_dict, strict=False)
34
- # acoustic.load_state_dict(acoustic_state_dict, strict=False)
35
- # hifigan.load_state_dict(hifigan_state_dict, strict=False)
36
 
37
  # Move models to CPU (if not already on CPU)
38
  hubert = hubert.to('cpu')
 
18
 
19
 
20
  # Load the models using torch.hub
21
+ hubert = torch.hub.load("bshall/hubert:main", "hubert_soft", trust_repo=True)
22
+ acoustic = torch.hub.load("bshall/acoustic-model:main", "hubert_soft", trust_repo=True, pretrained=False)
23
+ hifigan = torch.hub.load("bshall/hifigan:main", "hifigan_hubert_soft", trust_repo=True, pretrained=False)
24
 
25
 
26
  # Load the state dictionaries from the CPU-saved files
27
+ hubert_state_dict = torch.load("hubert_cpu.pt", map_location=torch.device('cpu'))
28
+ acoustic_state_dict = torch.load("acoustic_cpu.pt", map_location=torch.device('cpu'))
29
+ hifigan_state_dict = torch.load("hifigan_cpu.pt", map_location=torch.device('cpu'))
30
 
31
 
32
  # Set the state dictionaries to the models
33
+ hubert.load_state_dict(hubert_state_dict.state_dict(), strict=False)
34
+ acoustic.load_state_dict(acoustic_state_dict.state_dict(), strict=False)
35
+ hifigan.load_state_dict(hifigan_state_dict.state_dict(), strict=False)
36
 
37
  # Move models to CPU (if not already on CPU)
38
  hubert = hubert.to('cpu')