Codex commited on
Commit ·
5848d41
1
Parent(s): bcfd1a0
Create SoVITS checkpoint dirs before saving
Browse files
app.py
CHANGED
|
@@ -68,7 +68,7 @@ MODEL_PATTERNS = [
|
|
| 68 |
"*.safetensors",
|
| 69 |
"*.model",
|
| 70 |
]
|
| 71 |
-
UPSTREAM_PATCH_VERSION = "2026-05-26-s2-cpu-singleproc-
|
| 72 |
|
| 73 |
logging.basicConfig(level=logging.INFO, format="%(asctime)s [%(levelname)s] %(message)s")
|
| 74 |
log = logging.getLogger(__name__)
|
|
@@ -943,6 +943,29 @@ def patch_upstream_repo():
|
|
| 943 |
if old_load in sv_content:
|
| 944 |
sv_content = sv_content.replace(old_load, new_load, 1)
|
| 945 |
sv_script.write_text(sv_content, encoding="utf-8")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 946 |
data_module = GPT_SOVITS_DIR / "GPT_SoVITS" / "AR" / "data" / "data_module.py"
|
| 947 |
data_module.write_text(
|
| 948 |
"""# modified from https://github.com/yangdongchao/SoundStorm/blob/master/soundstorm/s1/AR/data/data_module.py
|
|
|
|
| 68 |
"*.safetensors",
|
| 69 |
"*.model",
|
| 70 |
]
|
| 71 |
+
UPSTREAM_PATCH_VERSION = "2026-05-26-s2-cpu-singleproc-v6"
|
| 72 |
|
| 73 |
logging.basicConfig(level=logging.INFO, format="%(asctime)s [%(levelname)s] %(message)s")
|
| 74 |
log = logging.getLogger(__name__)
|
|
|
|
| 943 |
if old_load in sv_content:
|
| 944 |
sv_content = sv_content.replace(old_load, new_load, 1)
|
| 945 |
sv_script.write_text(sv_content, encoding="utf-8")
|
| 946 |
+
process_ckpt = GPT_SOVITS_DIR / "GPT_SoVITS" / "process_ckpt.py"
|
| 947 |
+
process_ckpt_content = process_ckpt.read_text(encoding="utf-8")
|
| 948 |
+
if 'os.makedirs(dir, exist_ok=True)' not in process_ckpt_content:
|
| 949 |
+
process_ckpt_content = process_ckpt_content.replace(
|
| 950 |
+
' name = os.path.basename(path)\n',
|
| 951 |
+
' name = os.path.basename(path)\n os.makedirs(dir, exist_ok=True)\n',
|
| 952 |
+
1,
|
| 953 |
+
)
|
| 954 |
+
process_ckpt_content = process_ckpt_content.replace(
|
| 955 |
+
'def my_save2(fea, path, model_version):\n bio = BytesIO()\n',
|
| 956 |
+
'def my_save2(fea, path, model_version):\n os.makedirs(os.path.dirname(path), exist_ok=True)\n bio = BytesIO()\n',
|
| 957 |
+
1,
|
| 958 |
+
)
|
| 959 |
+
process_ckpt.write_text(process_ckpt_content, encoding="utf-8")
|
| 960 |
+
utils_py = GPT_SOVITS_DIR / "GPT_SoVITS" / "utils.py"
|
| 961 |
+
utils_content = utils_py.read_text(encoding="utf-8")
|
| 962 |
+
if 'os.makedirs(dir, exist_ok=True)' not in utils_content:
|
| 963 |
+
utils_content = utils_content.replace(
|
| 964 |
+
' name = os.path.basename(path)\n',
|
| 965 |
+
' name = os.path.basename(path)\n os.makedirs(dir, exist_ok=True)\n',
|
| 966 |
+
1,
|
| 967 |
+
)
|
| 968 |
+
utils_py.write_text(utils_content, encoding="utf-8")
|
| 969 |
data_module = GPT_SOVITS_DIR / "GPT_SoVITS" / "AR" / "data" / "data_module.py"
|
| 970 |
data_module.write_text(
|
| 971 |
"""# modified from https://github.com/yangdongchao/SoundStorm/blob/master/soundstorm/s1/AR/data/data_module.py
|