Spaces:
Runtime error
Runtime error
Commit
·
66c448d
1
Parent(s):
890bef9
Update app.py
Browse files
app.py
CHANGED
|
@@ -204,7 +204,7 @@ if __name__ == "__main__":
|
|
| 204 |
emotional_model = EmotionModel.from_pretrained(emotional_model_name).to(device)
|
| 205 |
hps = utils.get_hparams_from_file('Data/BanGDream/configs/config.json')
|
| 206 |
net_g = get_net_g(
|
| 207 |
-
model_path='Data/BanGDream/models/
|
| 208 |
)
|
| 209 |
speaker_ids = hps.data.spk2id
|
| 210 |
speakers = list(speaker_ids.keys())
|
|
@@ -218,6 +218,10 @@ if __name__ == "__main__":
|
|
| 218 |
with gr.TabItem(band):
|
| 219 |
for name in BandList[band]:
|
| 220 |
with gr.TabItem(name):
|
|
|
|
|
|
|
|
|
|
|
|
|
| 221 |
with gr.Row():
|
| 222 |
with gr.Column():
|
| 223 |
with gr.Row():
|
|
@@ -256,7 +260,7 @@ if __name__ == "__main__":
|
|
| 256 |
placeholder="输入纯日语或者中文",
|
| 257 |
value="为什么要演奏春日影!",
|
| 258 |
)
|
| 259 |
-
reference_audio = gr.
|
| 260 |
btn = gr.Button("点击生成", variant="primary")
|
| 261 |
audio_output = gr.Audio(label="Output Audio")
|
| 262 |
'''
|
|
|
|
| 204 |
emotional_model = EmotionModel.from_pretrained(emotional_model_name).to(device)
|
| 205 |
hps = utils.get_hparams_from_file('Data/BanGDream/configs/config.json')
|
| 206 |
net_g = get_net_g(
|
| 207 |
+
model_path='Data/BanGDream/models/G_132000.pth', version="2.1", device=device, hps=hps
|
| 208 |
)
|
| 209 |
speaker_ids = hps.data.spk2id
|
| 210 |
speakers = list(speaker_ids.keys())
|
|
|
|
| 218 |
with gr.TabItem(band):
|
| 219 |
for name in BandList[band]:
|
| 220 |
with gr.TabItem(name):
|
| 221 |
+
classifiedPaths = []
|
| 222 |
+
for dirpath, dirnames, filenames in os.walk("Data/BanGDream/classifedSample/"+name):
|
| 223 |
+
for filename in filenames:
|
| 224 |
+
classifiedPaths.append(os.path.join(dirpath, filename))
|
| 225 |
with gr.Row():
|
| 226 |
with gr.Column():
|
| 227 |
with gr.Row():
|
|
|
|
| 260 |
placeholder="输入纯日语或者中文",
|
| 261 |
value="为什么要演奏春日影!",
|
| 262 |
)
|
| 263 |
+
reference_audio = gr.Dropdown(label = "情感参考", choices = classifiedPaths, value = classifiedPaths[0], type = "value")
|
| 264 |
btn = gr.Button("点击生成", variant="primary")
|
| 265 |
audio_output = gr.Audio(label="Output Audio")
|
| 266 |
'''
|