RVC-Boss/GPT-SoVITS · error · FileExistsError
{path_sovits}SoVITS {model_version}底模缺失,无法加载相应 LoRA 权重
Error message
{path_sovits}SoVITS {model_version}底模缺失,无法加载相应 LoRA 权重 What it means
Same guard as inference_webui.py:273 but in the fast webui variant. change_sovits_weights() detects the selected checkpoint is a v3/v4 LoRA (if_lora_v3 True) and the corresponding base model presence flag (is_exist_s2gv3/is_exist_s2gv4) is False, so it warns via gr.Warning and raises FileExistsError listing the missing base-model path. LoRA checkpoints are deltas and cannot be loaded without the pretrained base.
Source
Thrown at GPT_SoVITS/inference_webui_fast.py:244
sovits_path = sovits_path[0]
from process_ckpt import get_sovits_version_from_path_fast
v3v4set = {"v3", "v4"}
def change_sovits_weights(sovits_path, prompt_language=None, text_language=None):
if "!" in sovits_path or "!" in sovits_path:
sovits_path = name2sovits_path[sovits_path]
global version, model_version, dict_language, if_lora_v3
version, model_version, if_lora_v3 = get_sovits_version_from_path_fast(sovits_path)
# print(sovits_path,version, model_version, if_lora_v3)
is_exist = is_exist_s2gv3 if model_version == "v3" else is_exist_s2gv4
path_sovits = path_sovits_v3 if model_version == "v3" else path_sovits_v4
if if_lora_v3 == True and is_exist == False:
info = path_sovits + "SoVITS %s" % model_version + i18n("底模缺失,无法加载相应 LoRA 权重")
gr.Warning(info)
raise FileExistsError(info)
dict_language = dict_language_v1 if version == "v1" else dict_language_v2
if prompt_language is not None and text_language is not None:
if prompt_language in list(dict_language.keys()):
prompt_text_update, prompt_language_update = (
{"__type__": "update"},
{"__type__": "update", "value": prompt_language},
)
else:
prompt_text_update = {"__type__": "update", "value": ""}
prompt_language_update = {"__type__": "update", "value": i18n("中文")}
if text_language in list(dict_language.keys()):
text_update, text_language_update = {"__type__": "update"}, {"__type__": "update", "value": text_language}
else:
text_update = {"__type__": "update", "value": ""}
text_language_update = {"__type__": "update", "value": i18n("中文")}
if model_version in v3v4set:
visible_sample_steps = True
visible_inp_refs = FalseView on GitHub (pinned to d523079fc0)
Solutions
- Download the pretrained bundle including v3/v4 base sovits models into GPT_SoVITS/pretrained_models/.
- Verify the paths behind path_sovits_v3/path_sovits_v4 exist; fix the constants if you moved the folder.
- Use a full (merged) v1/v2 checkpoint instead of the LoRA if you cannot obtain base models.
- Maintainers: align exception type with the condition (FileNotFoundError, not FileExistsError).
Example fix
# before # fast webui: FileExistsError: .../s2Gv4.pth SoVITS v4 底模缺失,无法加载相应 LoRA 权重 # after # wget pretrained bundle; confirm files, then reselect checkpoint in dropdown # ls GPT_SoVITS/pretrained_models/s2Gv4.pth GPT_SoVITS/pretrained_models/s2Dv4.pth
Defensive patterns
Strategy: validation
Validate before calling
import os
# before letting the UI change weights, check lora/base availability
_, model_version, if_lora = get_sovits_version_from_path_fast(sovits_path)
if if_lora:
base = path_sovits_v3 if model_version == "v3" else path_sovits_v4
if not os.path.exists(base):
gr.Warning(f"缺少底模 {base},请先下载")
return keep_current() Try / catch
try:
change_sovits_weights(p)
except FileExistsError as e:
gr.Warning(str(e)) # base model missing — instruct download, keep old model Prevention
- Ship or fetch the full pretrained set when deploying the fast webui.
- Verify v3/v4 base files exist before enabling LoRA checkpoints in the dropdown.
- Remember FileExistsError here actually signals a missing file.
When it happens
Trigger: In inference_webui_fast.py, changing the sovits weights dropdown to a v3/v4 LoRA .pth when the s2Gv3/s2Dv3 or s2Gv4/s2Dv4 base files are absent from the expected pretrained_models paths.
Common situations: Fast webui used on a machine where only v2 pretrained models were downloaded; LoRA checkpoint distributed without instructions to fetch base models; pretrained folder relocated/renamed.
Related errors
- SoVITS %s 底模缺失,无法加载相应 LoRA 权重
- {path_sovits}SoVITS {model_version}底模缺失,无法加载相应 LoRA 权重
- Cannot locate {filename} in candidate dirs: {candidate_dirs}
- Files not found: {paths}
- SoVits V3/4模型不支持流式推理模式
AI-assisted analysis of RVC-Boss/GPT-SoVITS@d523079fc0 (2026-08-15).
Data as JSON: /api/errors/a4c106e390e30683.
Report an issue: GitHub.