Compare commits

...

5 Commits

Author SHA1 Message Date
Spr_Aachen
e8042defc0
Merge dffefeab8422bb3a452b31f5b898dc19fd0c87f1 into 9da7e17efe05041e31d3c3f42c8730ae890397f2 2025-04-01 18:49:39 +08:00
RVC-Boss
9da7e17efe
Add files via upload 2025-04-01 18:44:35 +08:00
RVC-Boss
b0de354c63
Update Changelog_CN.md 2025-04-01 17:21:48 +08:00
RVC-Boss
41090e5a7c
Update g2pw url 2025-04-01 17:15:52 +08:00
Spr_Aachen
dffefeab84 Update api.py
- Address parameter assignment issue for DefaultRefer class
- Standarlize parameter passing in initialization section
2025-04-01 10:50:40 +08:00
4 changed files with 37 additions and 15 deletions

View File

@ -227,8 +227,8 @@ def change_sovits_weights(sovits_path,prompt_language=None,text_language=None):
global version, model_version, dict_language,if_lora_v3 global version, model_version, dict_language,if_lora_v3
version, model_version, if_lora_v3=get_sovits_version_from_path_fast(sovits_path) version, model_version, if_lora_v3=get_sovits_version_from_path_fast(sovits_path)
# print(sovits_path,version, model_version, if_lora_v3) # print(sovits_path,version, model_version, if_lora_v3)
if if_lora_v3==True and is_exist_s2gv3==False:# if if_lora_v3 and not os.path.exists(path_sovits_v3):
info= "GPT_SoVITS/pretrained_models/s2Gv3.pth" + i18n("SoVITS V3 底模缺失,无法加载相应 LoRA 权重") info= path_sovits_v3 + i18n("SoVITS V3 底模缺失,无法加载相应 LoRA 权重")
gr.Warning(info) gr.Warning(info)
raise FileExistsError(info) raise FileExistsError(info)
dict_language = dict_language_v1 if version =='v1' else dict_language_v2 dict_language = dict_language_v1 if version =='v1' else dict_language_v2

View File

@ -58,7 +58,7 @@ def download_and_decompress(model_dir: str='G2PWModel/'):
extract_dir = os.path.join(parent_directory,"G2PWModel_1.1") extract_dir = os.path.join(parent_directory,"G2PWModel_1.1")
extract_dir_new = os.path.join(parent_directory,"G2PWModel") extract_dir_new = os.path.join(parent_directory,"G2PWModel")
print("Downloading g2pw model...") print("Downloading g2pw model...")
modelscope_url = "https://paddlespeech.cdn.bcebos.com/Parakeet/released_models/g2p/G2PWModel_1.1.zip" modelscope_url = "https://www.modelscope.cn/models/kamiorinn/g2pw/resolve/master/G2PWModel_1.1.zip"#"https://paddlespeech.cdn.bcebos.com/Parakeet/released_models/g2p/G2PWModel_1.1.zip"
with requests.get(modelscope_url, stream=True) as r: with requests.get(modelscope_url, stream=True) as r:
r.raise_for_status() r.raise_for_status()
with open(zip_dir, 'wb') as f: with open(zip_dir, 'wb') as f:

32
api.py
View File

@ -176,9 +176,9 @@ import subprocess
class DefaultRefer: class DefaultRefer:
def __init__(self, path, text, language): def __init__(self, path, text, language):
self.path = args.default_refer_path self.path = path
self.text = args.default_refer_text self.text = text
self.language = args.default_refer_language self.language = language
def is_ready(self) -> bool: def is_ready(self) -> bool:
return is_full(self.path, self.text, self.language) return is_full(self.path, self.text, self.language)
@ -934,15 +934,23 @@ parser.add_argument("-b", "--bert_path", type=str, default=g_config.bert_path, h
args = parser.parse_args() args = parser.parse_args()
sovits_path = args.sovits_path sovits_path = args.sovits_path
gpt_path = args.gpt_path gpt_path = args.gpt_path
default_refer_path = args.default_refer_path
default_refer_text = args.default_refer_text
default_refer_language = args.default_refer_language
device = args.device device = args.device
port = args.port port = args.port
host = args.bind_addr host = args.bind_addr
full_precision = args.full_precision
half_precision = args.half_precision
stream_mode = args.stream_mode
media_type = args.media_type
sub_type = args.sub_type
default_cut_punc = args.cut_punc
cnhubert_base_path = args.hubert_path cnhubert_base_path = args.hubert_path
bert_path = args.bert_path bert_path = args.bert_path
default_cut_punc = args.cut_punc
# 应用参数配置 # 应用参数配置
default_refer = DefaultRefer(args.default_refer_path, args.default_refer_text, args.default_refer_language) default_refer = DefaultRefer(default_refer_path, default_refer_text, default_refer_language)
# 模型路径检查 # 模型路径检查
if sovits_path == "": if sovits_path == "":
@ -963,24 +971,24 @@ else:
# 获取半精度 # 获取半精度
is_half = g_config.is_half is_half = g_config.is_half
if args.full_precision: if full_precision:
is_half = False is_half = False
if args.half_precision: if half_precision:
is_half = True is_half = True
if args.full_precision and args.half_precision: if full_precision and half_precision:
is_half = g_config.is_half # 炒饭fallback is_half = g_config.is_half # 炒饭fallback
logger.info(f"半精: {is_half}") logger.info(f"半精: {is_half}")
# 流式返回模式 # 流式返回模式
if args.stream_mode.lower() in ["normal","n"]: if stream_mode.lower() in ["normal","n"]:
stream_mode = "normal" stream_mode = "normal"
logger.info("流式返回已开启") logger.info("流式返回已开启")
else: else:
stream_mode = "close" stream_mode = "close"
# 音频编码格式 # 音频编码格式
if args.media_type.lower() in ["aac","ogg"]: if media_type.lower() in ["aac","ogg"]:
media_type = args.media_type.lower() media_type = media_type.lower()
elif stream_mode == "close": elif stream_mode == "close":
media_type = "wav" media_type = "wav"
else: else:
@ -988,7 +996,7 @@ else:
logger.info(f"编码格式: {media_type}") logger.info(f"编码格式: {media_type}")
# 音频数据类型 # 音频数据类型
if args.sub_type.lower() == 'int32': if sub_type.lower() == 'int32':
is_int32 = True is_int32 = True
logger.info(f"数据类型: int32") logger.info(f"数据类型: int32")
else: else:

View File

@ -286,3 +286,17 @@ https://github.com/RVC-Boss/GPT-SoVITS/pull/2112 https://github.com/RVC-Boss/GPT
修复短文本语种选择出错 https://github.com/RVC-Boss/GPT-SoVITS/pull/2122 修复短文本语种选择出错 https://github.com/RVC-Boss/GPT-SoVITS/pull/2122
修复v3sovits未传参以支持调节语速 修复v3sovits未传参以支持调节语速
### 202503
修复一批由依赖的库版本不对导致的问题https://github.com/RVC-Boss/GPT-SoVITS/commit/6c468583c5566e5fbb4fb805e4cc89c403e997b8
修复模型加载异步逻辑https://github.com/RVC-Boss/GPT-SoVITS/commit/03b662a769946b7a6a8569a354860e8eeeb743aa
修复其他若干bug
重点更新:
1-v3支持并行推理 https://github.com/RVC-Boss/GPT-SoVITS/commit/03b662a769946b7a6a8569a354860e8eeeb743aa
2-整合包修复onnxruntime GPU推理的支持影响1g2pw有个onnx模型原先是CPU推理现在用GPU显著降低推理的CPU瓶颈 2foxjoy去混响模型现在可使用GPU推理