SefyanKehail commited on
Commit
83b4e28
·
1 Parent(s): 1ec1181

debugging..

Browse files
Files changed (1) hide show
  1. app.py +11 -15
app.py CHANGED
@@ -18,25 +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)
23
- # hifigan = torch.hub.load("bshall/hifigan:main", "hifigan_hubert_soft", trust_repo=True)
24
 
25
 
26
- hubert = torch.load("hubert_cpu.pt", map_location=torch.device('cpu'))
27
- acoustic = torch.load("acoustic_cpu.pt", map_location=torch.device('cpu'))
28
- hifigan = torch.load("hifigan_cpu.pt", map_location=torch.device('cpu'))
 
29
 
30
- # # Load the state dictionaries from the CPU-saved files
31
- # hubert_state_dict = hubert.state_dict()
32
- # acoustic_state_dict = acoustic.state_dict()
33
- # hifigan_state_dict = hifigan.state_dict()
34
 
35
-
36
- # # Set the state dictionaries to the models
37
- # hubert.load_state_dict(hubert_state_dict, strict=False)
38
- # acoustic.load_state_dict(acoustic_state_dict, strict=False)
39
- # hifigan.load_state_dict(hifigan_state_dict, strict=False)
40
 
41
  # Move models to CPU (if not already on CPU)
42
  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, 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')