Skip to content

Commit 20c49a3

Browse files
api接口,修复文本切分符号设定中,中文分号错写为英文分号的问题 (#1001)
1 parent 96b53be commit 20c49a3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

api.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ def read_clean_buffer(audio_bytes):
382382

383383

384384
def cut_text(text, punc):
385-
punc_list = [p for p in punc if p in {",", ".", ";", "?", "!", "、", ",", "。", "?", "!", ";", ":", "…"}]
385+
punc_list = [p for p in punc if p in {",", ".", ";", "?", "!", "、", ",", "。", "?", "!", "", ":", "…"}]
386386
if len(punc_list) > 0:
387387
punds = r"[" + "".join(punc_list) + r"]"
388388
text = text.strip("\n")
@@ -580,7 +580,7 @@ def handle(refer_wav_path, prompt_text, prompt_language, text, text_language, cu
580580
# 此时 full_precision==True, half_precision==False
581581
parser.add_argument("-sm", "--stream_mode", type=str, default="close", help="流式返回模式, close / normal / keepalive")
582582
parser.add_argument("-mt", "--media_type", type=str, default="wav", help="音频编码格式, wav / ogg / aac")
583-
parser.add_argument("-cp", "--cut_punc", type=str, default="", help="文本切分符号设定, 符号范围,.;?!、,。?!;:…")
583+
parser.add_argument("-cp", "--cut_punc", type=str, default="", help="文本切分符号设定, 符号范围,.;?!、,。?!:…")
584584
# 切割常用分句符为 `python ./api.py -cp ".?!。?!"`
585585
parser.add_argument("-hb", "--hubert_path", type=str, default=g_config.cnhubert_path, help="覆盖config.cnhubert_path")
586586
parser.add_argument("-b", "--bert_path", type=str, default=g_config.bert_path, help="覆盖config.bert_path")

0 commit comments

Comments
 (0)