mirror of
https://github.com/RVC-Boss/GPT-SoVITS.git
synced 2026-01-08 03:06:57 +08:00
Merge branch 'RVC-Boss:main' into dev
This commit is contained in:
commit
5be9465559
@ -3,8 +3,8 @@
|
|||||||
import sys
|
import sys
|
||||||
import re
|
import re
|
||||||
import cn2an
|
import cn2an
|
||||||
|
import ToJyutping
|
||||||
|
|
||||||
from pyjyutping import jyutping
|
|
||||||
from text.symbols import punctuation
|
from text.symbols import punctuation
|
||||||
from text.zh_normalization.text_normlization import TextNormalizer
|
from text.zh_normalization.text_normlization import TextNormalizer
|
||||||
|
|
||||||
@ -173,12 +173,24 @@ def jyuping_to_initials_finals_tones(jyuping_syllables):
|
|||||||
|
|
||||||
|
|
||||||
def get_jyutping(text):
|
def get_jyutping(text):
|
||||||
jp = jyutping.convert(text)
|
jyutping_array = []
|
||||||
# print(1111111,jp)
|
punct_pattern = re.compile(r"^[{}]+$".format(re.escape("".join(punctuation))))
|
||||||
for symbol in punctuation:
|
|
||||||
jp = jp.replace(symbol, " " + symbol + " ")
|
syllables = ToJyutping.get_jyutping_list(text)
|
||||||
jp_array = jp.split()
|
|
||||||
return jp_array
|
for word, syllable in syllables:
|
||||||
|
if punct_pattern.match(word):
|
||||||
|
puncts = re.split(r"([{}])".format(re.escape("".join(punctuation))), word)
|
||||||
|
for punct in puncts:
|
||||||
|
if len(punct) > 0:
|
||||||
|
jyutping_array.append(punct)
|
||||||
|
else:
|
||||||
|
# match multple jyutping eg: liu4 ge3, or single jyutping eg: liu4
|
||||||
|
if not re.search(r"^([a-z]+[1-6]+[ ]?)+$", syllable):
|
||||||
|
raise ValueError(f"Failed to convert {word} to jyutping: {syllable}")
|
||||||
|
jyutping_array.append(syllable)
|
||||||
|
|
||||||
|
return jyutping_array
|
||||||
|
|
||||||
|
|
||||||
def get_bert_feature(text, word2ph):
|
def get_bert_feature(text, word2ph):
|
||||||
|
|||||||
@ -144,11 +144,16 @@ def read_dict():
|
|||||||
return polyphonic_dict
|
return polyphonic_dict
|
||||||
|
|
||||||
|
|
||||||
def correct_pronunciation(word,word_pinyins):
|
def correct_pronunciation(word, word_pinyins):
|
||||||
if word in pp_dict:
|
new_pinyins = pp_dict.get(word, "")
|
||||||
word_pinyins = pp_dict[word]
|
if new_pinyins == "":
|
||||||
|
for idx, w in enumerate(word):
|
||||||
return word_pinyins
|
w_pinyin = pp_dict.get(w, "")
|
||||||
|
if w_pinyin != "":
|
||||||
|
word_pinyins[idx] = w_pinyin[0]
|
||||||
|
return word_pinyins
|
||||||
|
else:
|
||||||
|
return new_pinyins
|
||||||
|
|
||||||
|
|
||||||
pp_dict = get_dict()
|
pp_dict = get_dict()
|
||||||
|
|||||||
@ -27,7 +27,7 @@ LangSegment>=0.2.0
|
|||||||
Faster_Whisper
|
Faster_Whisper
|
||||||
wordsegment
|
wordsegment
|
||||||
rotary_embedding_torch
|
rotary_embedding_torch
|
||||||
pyjyutping
|
ToJyutping
|
||||||
g2pk2
|
g2pk2
|
||||||
ko_pron
|
ko_pron
|
||||||
opencc; sys_platform != 'linux'
|
opencc; sys_platform != 'linux'
|
||||||
|
|||||||
2
webui.py
2
webui.py
@ -72,7 +72,7 @@ mem = []
|
|||||||
if_gpu_ok = False
|
if_gpu_ok = False
|
||||||
|
|
||||||
# 判断是否有能用来训练和加速推理的N卡
|
# 判断是否有能用来训练和加速推理的N卡
|
||||||
ok_gpu_keywords={"10","16","20","30","40","A2","A3","A4","P4","A50","500","A60","70","80","90","M4","T4","TITAN","L4","4060","H"}
|
ok_gpu_keywords={"10","16","20","30","40","A2","A3","A4","P4","A50","500","A60","70","80","90","M4","T4","TITAN","L4","4060","H","600"}
|
||||||
set_gpu_numbers=set()
|
set_gpu_numbers=set()
|
||||||
if torch.cuda.is_available() or ngpu != 0:
|
if torch.cuda.is_available() or ngpu != 0:
|
||||||
for i in range(ngpu):
|
for i in range(ngpu):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user