Codex commited on
Commit ·
9fe20c7
1
Parent(s): d92a478
Widen SoVITS cleanup to all resume dirs
Browse files
app.py
CHANGED
|
@@ -721,12 +721,16 @@ def cleanup_sovits_outputs(version=DEFAULT_VERSION):
|
|
| 721 |
terminate_pid(int(sovits_status["pid"]))
|
| 722 |
for path in ctx.sovits_output_dir.glob("*.pth"):
|
| 723 |
path.unlink()
|
| 724 |
-
|
| 725 |
-
|
|
|
|
|
|
|
|
|
|
| 726 |
ctx.sovits_ckpt_dir.mkdir(parents=True, exist_ok=True)
|
| 727 |
clear_live_log(ctx.sovits_live_log)
|
| 728 |
clear_status_file(ctx.sovits_status_path)
|
| 729 |
-
|
|
|
|
| 730 |
return manager_action_result(version, status, None)
|
| 731 |
|
| 732 |
|
|
|
|
| 721 |
terminate_pid(int(sovits_status["pid"]))
|
| 722 |
for path in ctx.sovits_output_dir.glob("*.pth"):
|
| 723 |
path.unlink()
|
| 724 |
+
removed_dirs = []
|
| 725 |
+
for directory in sorted({ctx.sovits_ckpt_dir, *ctx.exp_dir.glob("logs_s2_*")}):
|
| 726 |
+
if directory.exists():
|
| 727 |
+
shutil.rmtree(directory)
|
| 728 |
+
removed_dirs.append(directory.name)
|
| 729 |
ctx.sovits_ckpt_dir.mkdir(parents=True, exist_ok=True)
|
| 730 |
clear_live_log(ctx.sovits_live_log)
|
| 731 |
clear_status_file(ctx.sovits_status_path)
|
| 732 |
+
suffix = f" 已删除目录: {', '.join(removed_dirs)}" if removed_dirs else ""
|
| 733 |
+
status = f"已清理 {ctx.spec.version} 的 SoVITS 输出和训练断点。{suffix}"
|
| 734 |
return manager_action_result(version, status, None)
|
| 735 |
|
| 736 |
|