RVC-Boss/GPT-SoVITS · error · FileExistsError

{path_sovits}SoVITS {model_version}底模缺失,无法加载相应 LoRA 权重

Error message

{path_sovits}SoVITS {model_version}底模缺失,无法加载相应 LoRA 权重

What it means

Raised by the webui's change_sovits_weights(): when the selected sovits file is detected as a v3/v4 LoRA (if_lora_v3 True) but the matching base model file (path_sovits_v3 / path_sovits_v4, presence flags is_exist_s2gv3/s2gv4) is missing. Functionally identical to the TTS.py variant: LoRA adapters need the pretrained base to merge onto; the webui additionally shows a gr.Warning before raising FileExistsError (note: the exception type is misleading, it is a missing-file condition).

Source

Thrown at GPT_SoVITS/inference_webui.py:273

# symbol_version-model_version-if_lora_v3
from process_ckpt import get_sovits_version_from_path_fast, load_sovits_new

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 vq_model, hps, version, model_version, dict_language, if_lora_v3, t2s_model_cudagraph
    t2s_model_cudagraph = None
    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 = False

View on GitHub (pinned to d523079fc0)

Solutions

  1. Download the pretrained models bundle (includes s2Gv3/s2Dv3, s2Gv4/s2Dv4) into GPT_SoVITS/pretrained_models/ as documented on the project README.
  2. Confirm the exact paths referenced by path_sovits_v3/path_sovits_v4 exist on disk after download.
  3. If v3/v4 are not needed, pick a full v1/v2 sovits checkpoint which needs no base model.
  4. Maintainers: consider correcting the exception class to FileNotFoundError to match the actual condition.

Example fix

# before (webui log): FileExistsError: .../s2Gv3.pth SoVITS v3 底模缺失,无法加载相应 LoRA 权重

# after: place base models, verify, then reload in UI
# ls GPT_SoVITS/pretrained_models/  ->  s2Gv3.pth s2Dv3.pth s2Gv4.pth s2Dv4.pth ...
Defensive patterns

Strategy: validation

Validate before calling

import os
from GPT_SoVITS.inference_webui import is_exist_s2gv3, is_exist_s2gv4, path_sovits_v3, path_sovits_v4, get_sovits_version_from_path_fast

_, model_version, if_lora = get_sovits_version_from_path_fast(sovits_path)
base_ok = is_exist_s2gv3 if model_version == "v3" else is_exist_s2gv4
expected = path_sovits_v3 if model_version == "v3" else path_sovits_v4
if if_lora and not base_ok:
    raise SystemExit(f"download base model to {expected} before loading this LoRA")

Try / catch

try:
    change_sovits_weights(selected)
except FileExistsError as e:  # misleading name: actually means base model missing
    gr.Warning(str(e)); keep_previous_model_loaded()

Prevention

When it happens

Trigger: In the Gradio webui, selecting/dropdown-changing a sovits checkpoint that is a v3 or v4 LoRA while GPT_SoVITS/pretrained_models lacks the s2Gv3/s2Dv3 or s2Gv4/s2Dv4 base .pth files (is_exist flag False).

Common situations: Fresh clone without downloading the full pretrained-model bundle; user shares only their finetuned lora .pth and recipient loads it without base models; pretrained_models folder moved and path_sovits_v3/v4 globals not updated.

Related errors


AI-assisted analysis of RVC-Boss/GPT-SoVITS@d523079fc0 (2026-08-15). Data as JSON: /api/errors/914257cb326d1c51. Report an issue: GitHub.