skytnt commited on
Commit
c7f6767
β€’
1 Parent(s): be80077

add Chinese dialects models

Browse files
app.py CHANGED
@@ -177,6 +177,7 @@ if __name__ == '__main__':
177
  models_info = json.load(f)
178
  for i, info in models_info.items():
179
  name = info["title"]
 
180
  lang = info["lang"]
181
  example = info["example"]
182
  config_path = f"saved_model/{i}/config.json"
@@ -197,12 +198,12 @@ if __name__ == '__main__':
197
 
198
  t = info["type"]
199
  if t == "vits":
200
- models_tts.append((name, cover_path, speakers, lang, example,
201
  hps.symbols, create_tts_fn(model, hps, speaker_ids),
202
  create_to_symbol_fn(hps)))
203
- models_vc.append((name, cover_path, speakers, create_vc_fn(model, hps, speaker_ids)))
204
  elif t == "soft-vits-vc":
205
- models_soft_vc.append((name, cover_path, speakers, create_soft_vc_fn(model, hps, speaker_ids)))
206
 
207
  hubert = torch.hub.load("bshall/hubert:main", "hubert_soft", trust_repo=True).to(device)
208
 
@@ -217,14 +218,15 @@ if __name__ == '__main__':
217
  with gr.Tabs():
218
  with gr.TabItem("TTS"):
219
  with gr.Tabs():
220
- for i, (name, cover_path, speakers, lang, example, symbols, tts_fn,
221
  to_symbol_fn) in enumerate(models_tts):
222
  with gr.TabItem(f"model{i}"):
223
  with gr.Column():
224
  cover_markdown = f"![cover](file/{cover_path})\n\n" if cover_path else ""
225
  gr.Markdown(f"## {name}\n\n"
226
  f"{cover_markdown}"
227
- f"lang: {lang}")
 
228
  tts_input1 = gr.TextArea(label="Text (150 words limitation)", value=example,
229
  elem_id=f"tts-input{i}")
230
  tts_input2 = gr.Dropdown(label="Speaker", choices=speakers,
@@ -271,11 +273,12 @@ if __name__ == '__main__':
271
 
272
  with gr.TabItem("Voice Conversion"):
273
  with gr.Tabs():
274
- for i, (name, cover_path, speakers, vc_fn) in enumerate(models_vc):
275
  with gr.TabItem(f"model{i}"):
276
  cover_markdown = f"![cover](file/{cover_path})\n\n" if cover_path else ""
277
  gr.Markdown(f"## {name}\n\n"
278
- f"{cover_markdown}")
 
279
  vc_input1 = gr.Dropdown(label="Original Speaker", choices=speakers, type="index",
280
  value=speakers[0])
281
  vc_input2 = gr.Dropdown(label="Target Speaker", choices=speakers, type="index",
@@ -289,11 +292,12 @@ if __name__ == '__main__':
289
  vc_submit.click(vc_fn, [vc_input1, vc_input2, vc_input3], [vc_output1, vc_output2])
290
  with gr.TabItem("Soft Voice Conversion"):
291
  with gr.Tabs():
292
- for i, (name, cover_path, speakers, soft_vc_fn) in enumerate(models_soft_vc):
293
  with gr.TabItem(f"model{i}"):
294
  cover_markdown = f"![cover](file/{cover_path})\n\n" if cover_path else ""
295
  gr.Markdown(f"## {name}\n\n"
296
- f"{cover_markdown}")
 
297
  vc_input1 = gr.Dropdown(label="Target Speaker", choices=speakers, type="index",
298
  value=speakers[0])
299
  source_tabs = gr.Tabs()
177
  models_info = json.load(f)
178
  for i, info in models_info.items():
179
  name = info["title"]
180
+ author = info["author"]
181
  lang = info["lang"]
182
  example = info["example"]
183
  config_path = f"saved_model/{i}/config.json"
198
 
199
  t = info["type"]
200
  if t == "vits":
201
+ models_tts.append((name, author, cover_path, speakers, lang, example,
202
  hps.symbols, create_tts_fn(model, hps, speaker_ids),
203
  create_to_symbol_fn(hps)))
204
+ models_vc.append((name, author, cover_path, speakers, create_vc_fn(model, hps, speaker_ids)))
205
  elif t == "soft-vits-vc":
206
+ models_soft_vc.append((name, author, cover_path, speakers, create_soft_vc_fn(model, hps, speaker_ids)))
207
 
208
  hubert = torch.hub.load("bshall/hubert:main", "hubert_soft", trust_repo=True).to(device)
209
 
218
  with gr.Tabs():
219
  with gr.TabItem("TTS"):
220
  with gr.Tabs():
221
+ for i, (name, author, cover_path, speakers, lang, example, symbols, tts_fn,
222
  to_symbol_fn) in enumerate(models_tts):
223
  with gr.TabItem(f"model{i}"):
224
  with gr.Column():
225
  cover_markdown = f"![cover](file/{cover_path})\n\n" if cover_path else ""
226
  gr.Markdown(f"## {name}\n\n"
227
  f"{cover_markdown}"
228
+ f"model author: {author}\n\n"
229
+ f"language: {lang}")
230
  tts_input1 = gr.TextArea(label="Text (150 words limitation)", value=example,
231
  elem_id=f"tts-input{i}")
232
  tts_input2 = gr.Dropdown(label="Speaker", choices=speakers,
273
 
274
  with gr.TabItem("Voice Conversion"):
275
  with gr.Tabs():
276
+ for i, (name, author, cover_path, speakers, vc_fn) in enumerate(models_vc):
277
  with gr.TabItem(f"model{i}"):
278
  cover_markdown = f"![cover](file/{cover_path})\n\n" if cover_path else ""
279
  gr.Markdown(f"## {name}\n\n"
280
+ f"{cover_markdown}"
281
+ f"model author: {author}")
282
  vc_input1 = gr.Dropdown(label="Original Speaker", choices=speakers, type="index",
283
  value=speakers[0])
284
  vc_input2 = gr.Dropdown(label="Target Speaker", choices=speakers, type="index",
292
  vc_submit.click(vc_fn, [vc_input1, vc_input2, vc_input3], [vc_output1, vc_output2])
293
  with gr.TabItem("Soft Voice Conversion"):
294
  with gr.Tabs():
295
+ for i, (name, author, cover_path, speakers, soft_vc_fn) in enumerate(models_soft_vc):
296
  with gr.TabItem(f"model{i}"):
297
  cover_markdown = f"![cover](file/{cover_path})\n\n" if cover_path else ""
298
  gr.Markdown(f"## {name}\n\n"
299
+ f"{cover_markdown}"
300
+ f"model author: {author}")
301
  vc_input1 = gr.Dropdown(label="Target Speaker", choices=speakers, type="index",
302
  value=speakers[0])
303
  source_tabs = gr.Tabs()
saved_model/16/config.json ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b8b975a5a4f39b989d3bf45ace6d5194b29897dbdbb17a4a6ac458fef084e838
3
+ size 1211
saved_model/16/model.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:750299355c3cd6bec4bca61ac50dbfb4c1e129be9b0806442cee24071bed657b
3
+ size 158882637
saved_model/17/config.json ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:099f3191034423876aa79987acbbe1308878c45859d86840311245614635da27
3
+ size 2174
saved_model/17/model.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5bafc0ad64442808ccbdc1c880846d4d7ed30e5db6b9c68982bade0070e135a9
3
+ size 158966349
saved_model/info.json CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:db3e22ccce9b2dad016ac66e10a940f67757553d3656a385be93f717f47513c3
3
- size 2761
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8b71ff5dab7d60ce8fdbe75fa48b607574b845b4b57fa119299e1f21216d41e7
3
+ size 4697