{"record":{"id":"914257cb326d1c51","repo":"RVC-Boss/GPT-SoVITS","slug":"path-sovits-sovits-model-version-lor","errorCode":null,"errorMessage":"{path_sovits}SoVITS {model_version}底模缺失，无法加载相应 LoRA 权重","messagePattern":"(.+?)SoVITS (.+?)底模缺失，无法加载相应 LoRA 权重","errorType":"exception","errorClass":"FileExistsError","httpStatus":null,"severity":"error","filePath":"GPT_SoVITS/inference_webui.py","lineNumber":273,"sourceCode":"# symbol_version-model_version-if_lora_v3\r\nfrom process_ckpt import get_sovits_version_from_path_fast, load_sovits_new\r\n\r\nv3v4set = {\"v3\", \"v4\"}\r\n\r\n\r\ndef change_sovits_weights(sovits_path, prompt_language=None, text_language=None):\r\n    if \"！\" in sovits_path or \"!\" in sovits_path:\r\n        sovits_path = name2sovits_path[sovits_path]\r\n    global vq_model, hps, version, model_version, dict_language, if_lora_v3, t2s_model_cudagraph\r\n    t2s_model_cudagraph = None\r\n    version, model_version, if_lora_v3 = get_sovits_version_from_path_fast(sovits_path)\r\n    print(sovits_path, version, model_version, if_lora_v3)\r\n    is_exist = is_exist_s2gv3 if model_version == \"v3\" else is_exist_s2gv4\r\n    path_sovits = path_sovits_v3 if model_version == \"v3\" else path_sovits_v4\r\n    if if_lora_v3 == True and is_exist == False:\r\n        info = path_sovits + \"SoVITS %s\" % model_version + i18n(\"底模缺失，无法加载相应 LoRA 权重\")\r\n        gr.Warning(info)\r\n        raise FileExistsError(info)\r\n    dict_language = dict_language_v1 if version == \"v1\" else dict_language_v2\r\n    if prompt_language is not None and text_language is not None:\r\n        if prompt_language in list(dict_language.keys()):\r\n            prompt_text_update, prompt_language_update = (\r\n                {\"__type__\": \"update\"},\r\n                {\"__type__\": \"update\", \"value\": prompt_language},\r\n            )\r\n        else:\r\n            prompt_text_update = {\"__type__\": \"update\", \"value\": \"\"}\r\n            prompt_language_update = {\"__type__\": \"update\", \"value\": i18n(\"中文\")}\r\n        if text_language in list(dict_language.keys()):\r\n            text_update, text_language_update = {\"__type__\": \"update\"}, {\"__type__\": \"update\", \"value\": text_language}\r\n        else:\r\n            text_update = {\"__type__\": \"update\", \"value\": \"\"}\r\n            text_language_update = {\"__type__\": \"update\", \"value\": i18n(\"中文\")}\r\n        if model_version in v3v4set:\r\n            visible_sample_steps = True\r\n            visible_inp_refs = False\r","sourceCodeStart":255,"sourceCodeEnd":291,"githubUrl":"https://github.com/RVC-Boss/GPT-SoVITS/blob/d523079fc05d9a8028d6085bffe4a2757c32abb6/GPT_SoVITS/inference_webui.py#L255-L291","documentation":"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).","triggerScenarios":"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).","commonSituations":"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.","solutions":["Download the pretrained models bundle (includes s2Gv3/s2Dv3, s2Gv4/s2Dv4) into GPT_SoVITS/pretrained_models/ as documented on the project README.","Confirm the exact paths referenced by path_sovits_v3/path_sovits_v4 exist on disk after download.","If v3/v4 are not needed, pick a full v1/v2 sovits checkpoint which needs no base model.","Maintainers: consider correcting the exception class to FileNotFoundError to match the actual condition."],"exampleFix":"# before (webui log): FileExistsError: .../s2Gv3.pth SoVITS v3 底模缺失，无法加载相应 LoRA 权重\n\n# after: place base models, verify, then reload in UI\n# ls GPT_SoVITS/pretrained_models/  ->  s2Gv3.pth s2Dv3.pth s2Gv4.pth s2Dv4.pth ...","handlingStrategy":"validation","validationCode":"import os\nfrom GPT_SoVITS.inference_webui import is_exist_s2gv3, is_exist_s2gv4, path_sovits_v3, path_sovits_v4, get_sovits_version_from_path_fast\n\n_, model_version, if_lora = get_sovits_version_from_path_fast(sovits_path)\nbase_ok = is_exist_s2gv3 if model_version == \"v3\" else is_exist_s2gv4\nexpected = path_sovits_v3 if model_version == \"v3\" else path_sovits_v4\nif if_lora and not base_ok:\n    raise SystemExit(f\"download base model to {expected} before loading this LoRA\")","typeGuard":null,"tryCatchPattern":"try:\n    change_sovits_weights(selected)\nexcept FileExistsError as e:  # misleading name: actually means base model missing\n    gr.Warning(str(e)); keep_previous_model_loaded()","preventionTips":["Download the complete pretrained bundle before using community LoRAs in the webui.","After any move of pretrained_models, verify the v3/v4 base files still resolve.","Note the exception type is FileExistsError but the condition is a missing file — catch accordingly."],"tags":["model-weights","lora","sovits","webui","missing-file"],"backgroundTag":null,"analyzedSha":"d523079fc05d9a8028d6085bffe4a2757c32abb6","analyzedAt":"2026-08-15T01:06:46.402Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}