修复环境变量可能不为str的问题

修复环境变量可能不为str的问题
This commit is contained in:
RVC-Boss 2025-09-10 15:01:04 +08:00 committed by GitHub
parent fdf794e31d
commit 11aa78bd9b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -343,7 +343,7 @@ def change_tts_inference(bert_path, cnhubert_base_path, gpu_number, gpt_path, so
os.environ["sovits_path"] = sovits_path os.environ["sovits_path"] = sovits_path
os.environ["cnhubert_base_path"] = cnhubert_base_path os.environ["cnhubert_base_path"] = cnhubert_base_path
os.environ["bert_path"] = bert_path os.environ["bert_path"] = bert_path
os.environ["_CUDA_VISIBLE_DEVICES"] = fix_gpu_number(gpu_number) os.environ["_CUDA_VISIBLE_DEVICES"] = str(fix_gpu_number(gpu_number))
os.environ["is_half"] = str(is_half) os.environ["is_half"] = str(is_half)
os.environ["infer_ttswebui"] = str(webui_port_infer_tts) os.environ["infer_ttswebui"] = str(webui_port_infer_tts)
os.environ["is_share"] = str(is_share) os.environ["is_share"] = str(is_share)
@ -628,7 +628,7 @@ def open1Bb(
data["output_dir"] = "%s/logs_s1_%s" % (s1_dir, version) data["output_dir"] = "%s/logs_s1_%s" % (s1_dir, version)
# data["version"]=version # data["version"]=version
os.environ["_CUDA_VISIBLE_DEVICES"] = fix_gpu_numbers(gpu_numbers.replace("-", ",")) os.environ["_CUDA_VISIBLE_DEVICES"] = str(fix_gpu_numbers(gpu_numbers.replace("-", ",")))
os.environ["hz"] = "25hz" os.environ["hz"] = "25hz"
tmp_config_path = "%s/tmp_s1.yaml" % tmp tmp_config_path = "%s/tmp_s1.yaml" % tmp
with open(tmp_config_path, "w") as f: with open(tmp_config_path, "w") as f:
@ -801,7 +801,7 @@ def open1a(inp_text, inp_wav_dir, exp_name, gpu_numbers, bert_pretrained_dir):
{ {
"i_part": str(i_part), "i_part": str(i_part),
"all_parts": str(all_parts), "all_parts": str(all_parts),
"_CUDA_VISIBLE_DEVICES": fix_gpu_number(gpu_names[i_part]), "_CUDA_VISIBLE_DEVICES": str(fix_gpu_number(gpu_names[i_part])),
"is_half": str(is_half), "is_half": str(is_half),
} }
) )
@ -892,7 +892,7 @@ def open1b(version, inp_text, inp_wav_dir, exp_name, gpu_numbers, ssl_pretrained
{ {
"i_part": str(i_part), "i_part": str(i_part),
"all_parts": str(all_parts), "all_parts": str(all_parts),
"_CUDA_VISIBLE_DEVICES": fix_gpu_number(gpu_names[i_part]), "_CUDA_VISIBLE_DEVICES": str(fix_gpu_number(gpu_names[i_part])),
} }
) )
os.environ.update(config) os.environ.update(config)
@ -914,7 +914,7 @@ def open1b(version, inp_text, inp_wav_dir, exp_name, gpu_numbers, ssl_pretrained
{ {
"i_part": str(i_part), "i_part": str(i_part),
"all_parts": str(all_parts), "all_parts": str(all_parts),
"_CUDA_VISIBLE_DEVICES": fix_gpu_number(gpu_names[i_part]), "_CUDA_VISIBLE_DEVICES": str(fix_gpu_number(gpu_names[i_part])),
} }
) )
os.environ.update(config) os.environ.update(config)
@ -986,7 +986,7 @@ def open1c(version, inp_text, inp_wav_dir, exp_name, gpu_numbers, pretrained_s2G
{ {
"i_part": str(i_part), "i_part": str(i_part),
"all_parts": str(all_parts), "all_parts": str(all_parts),
"_CUDA_VISIBLE_DEVICES": fix_gpu_number(gpu_names[i_part]), "_CUDA_VISIBLE_DEVICES": str(fix_gpu_number(gpu_names[i_part])),
} }
) )
os.environ.update(config) os.environ.update(config)
@ -1086,7 +1086,7 @@ def open1abc(
{ {
"i_part": str(i_part), "i_part": str(i_part),
"all_parts": str(all_parts), "all_parts": str(all_parts),
"_CUDA_VISIBLE_DEVICES": fix_gpu_number(gpu_names[i_part]), "_CUDA_VISIBLE_DEVICES": str(fix_gpu_number(gpu_names[i_part])),
} }
) )
os.environ.update(config) os.environ.update(config)
@ -1133,7 +1133,7 @@ def open1abc(
{ {
"i_part": str(i_part), "i_part": str(i_part),
"all_parts": str(all_parts), "all_parts": str(all_parts),
"_CUDA_VISIBLE_DEVICES": fix_gpu_number(gpu_names[i_part]), "_CUDA_VISIBLE_DEVICES": str(fix_gpu_number(gpu_names[i_part])),
} }
) )
os.environ.update(config) os.environ.update(config)
@ -1155,7 +1155,7 @@ def open1abc(
{ {
"i_part": str(i_part), "i_part": str(i_part),
"all_parts": str(all_parts), "all_parts": str(all_parts),
"_CUDA_VISIBLE_DEVICES": fix_gpu_number(gpu_names[i_part]), "_CUDA_VISIBLE_DEVICES": str(fix_gpu_number(gpu_names[i_part])),
} }
) )
os.environ.update(config) os.environ.update(config)
@ -1195,7 +1195,7 @@ def open1abc(
{ {
"i_part": str(i_part), "i_part": str(i_part),
"all_parts": str(all_parts), "all_parts": str(all_parts),
"_CUDA_VISIBLE_DEVICES": fix_gpu_number(gpu_names[i_part]), "_CUDA_VISIBLE_DEVICES": str(fix_gpu_number(gpu_names[i_part])),
} }
) )
os.environ.update(config) os.environ.update(config)
@ -1980,3 +1980,4 @@ with gr.Blocks(title="GPT-SoVITS WebUI", analytics_enabled=False, js=js, css=css
server_port=webui_port_main, server_port=webui_port_main,
# quiet=True, # quiet=True,
) )