Hưng commited on
Commit
41b7348
·
1 Parent(s): a0fbc02

update model link

Browse files
Files changed (1) hide show
  1. app.py +10 -2
app.py CHANGED
@@ -23,7 +23,7 @@ model = load_model(
23
  DiT,
24
  dict(dim=1024, depth=22, heads=16, ff_mult=2, text_dim=512, conv_layers=4),
25
  ckpt_path=str(
26
- cached_path("hf://zalopay/vietnamese-tts/model_960000.pt")
27
  ),
28
  mel_spec_type="vocos",
29
  vocab_file=str(cached_path("hf://zalopay/vietnamese-tts/vocab.txt")),
@@ -38,6 +38,8 @@ def infer(ref_audio_orig: str, ref_text: str, gen_text: str, speed: float = 1.0)
38
  if gen_text is None or gen_text.strip() == "":
39
  raise gr.Error("Text to generate is required.")
40
 
 
 
41
  if ref_text is None or ref_text.strip() == "":
42
  raise gr.Error("Ref Text is required.")
43
 
@@ -46,7 +48,7 @@ def infer(ref_audio_orig: str, ref_text: str, gen_text: str, speed: float = 1.0)
46
  gr.Info("Generated audio text: {} with audio file {} ".format(ref_text, ref_audio_orig))
47
  final_wave, final_sample_rate, combined_spectrogram = infer_process(
48
  ref_audio,
49
- ref_text,
50
  gen_text,
51
  model,
52
  vocoder,
@@ -103,6 +105,12 @@ iface = gr.Interface(
103
  "Bạn đã nhận được thanh toán thành công số tiền ba mươi ngàn đồng",
104
  1.0,
105
  ],
 
 
 
 
 
 
106
  ],
107
  )
108
 
 
23
  DiT,
24
  dict(dim=1024, depth=22, heads=16, ff_mult=2, text_dim=512, conv_layers=4),
25
  ckpt_path=str(
26
+ cached_path("hf://zalopay/vietnamese-tts/model_1290000.pt")
27
  ),
28
  mel_spec_type="vocos",
29
  vocab_file=str(cached_path("hf://zalopay/vietnamese-tts/vocab.txt")),
 
38
  if gen_text is None or gen_text.strip() == "":
39
  raise gr.Error("Text to generate is required.")
40
 
41
+ gen_text = " " + gen_text.lower()
42
+
43
  if ref_text is None or ref_text.strip() == "":
44
  raise gr.Error("Ref Text is required.")
45
 
 
48
  gr.Info("Generated audio text: {} with audio file {} ".format(ref_text, ref_audio_orig))
49
  final_wave, final_sample_rate, combined_spectrogram = infer_process(
50
  ref_audio,
51
+ ref_text.lower(),
52
  gen_text,
53
  model,
54
  vocoder,
 
105
  "Bạn đã nhận được thanh toán thành công số tiền ba mươi ngàn đồng",
106
  1.0,
107
  ],
108
+ [
109
+ "examples/pc-02.wav",
110
+ "sông Đồng Nai là con sông nội địa dài nhất Việt Nam, lớn thứ nhì nam bộ về lưu vực chỉ sau sông Cửu long",
111
+ "Ứng dụng thanh toán Zalopay chính thức ra mắt phiên bản mới với các thay đổi hấp dẫn, làm mới mọi trải nghiệm về tiền",
112
+ 1.0,
113
+ ],
114
  ],
115
  )
116