SefyanKehail
commited on
Commit
·
10d2c76
1
Parent(s):
aecdaa7
debugging..
Browse files
app.py
CHANGED
|
@@ -18,26 +18,24 @@ 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 |
# Load the state dictionaries from the CPU-saved files
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 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')
|
| 39 |
-
acoustic = acoustic.to('cpu')
|
| 40 |
-
hifigan = hifigan.to('cpu')
|
| 41 |
|
| 42 |
|
| 43 |
|
|
@@ -80,7 +78,6 @@ def enable_convert_button(audio):
|
|
| 80 |
return gr.update(interactive=True)
|
| 81 |
return gr.update(interactive=False)
|
| 82 |
|
| 83 |
-
|
| 84 |
def clear_components():
|
| 85 |
return None, None
|
| 86 |
|
|
|
|
| 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 |
# Load the state dictionaries from the CPU-saved files
|
| 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 |
# Set the state dictionaries to the models
|
| 31 |
+
# hubert.load_state_dict(hubert_state_dict.state_dict(), strict=False)
|
| 32 |
+
# acoustic.load_state_dict(acoustic_state_dict.state_dict(), strict=False)
|
| 33 |
+
# hifigan.load_state_dict(hifigan_state_dict.state_dict(), strict=False)
|
| 34 |
|
| 35 |
# Move models to CPU (if not already on CPU)
|
| 36 |
+
# hubert = hubert.to('cpu')
|
| 37 |
+
# acoustic = acoustic.to('cpu')
|
| 38 |
+
# hifigan = hifigan.to('cpu')
|
| 39 |
|
| 40 |
|
| 41 |
|
|
|
|
| 78 |
return gr.update(interactive=True)
|
| 79 |
return gr.update(interactive=False)
|
| 80 |
|
|
|
|
| 81 |
def clear_components():
|
| 82 |
return None, None
|
| 83 |
|