cortico-world-fish-sing 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/worker/engine.py +28 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cortico-world-fish-sing",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "让她真的开口唱:B 站点歌或本地文件 → 分离 → 换声 → 混音,本机出声或发 QQ 语音条",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"homepage": "https://github.com/FXYXL/cortico-world-fish-sing#readme",
|
|
22
22
|
"repository": {
|
|
23
23
|
"type": "git",
|
|
24
|
-
"url": "https://github.com/FXYXL/cortico-world-fish-sing.git"
|
|
24
|
+
"url": "git+https://github.com/FXYXL/cortico-world-fish-sing.git"
|
|
25
25
|
},
|
|
26
26
|
"bugs": {
|
|
27
27
|
"url": "https://github.com/FXYXL/cortico-world-fish-sing/issues"
|
package/worker/engine.py
CHANGED
|
@@ -33,7 +33,31 @@ import soundfile as sf
|
|
|
33
33
|
|
|
34
34
|
# ---------------------------------------------------------------- 常量
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
def _resolve_rvc_root() -> Path:
|
|
37
|
+
"""RVC 根目录的探测链。
|
|
38
|
+
|
|
39
|
+
之前默认写死 D:\\AI\\rvc,导致手动起 worker(没传 FISHSING_RVC_ROOT)时
|
|
40
|
+
引擎去 os.chdir 一个不存在的目录,报错还不直观。现在按顺序找:
|
|
41
|
+
|
|
42
|
+
1. FISHSING_RVC_ROOT(插件拉起时必传)
|
|
43
|
+
2. 自托管位置:FISHSING_WORK 的上级 runtime/rvc(runtime 里 venv 与 rvc 平级)
|
|
44
|
+
3. 老机器的开发目录 D:\\AI\\rvc、C:\\rvc
|
|
45
|
+
"""
|
|
46
|
+
env = os.environ.get("FISHSING_RVC_ROOT", "").strip()
|
|
47
|
+
if env:
|
|
48
|
+
return Path(env)
|
|
49
|
+
work = os.environ.get("FISHSING_WORK", "").strip()
|
|
50
|
+
if work:
|
|
51
|
+
cand = Path(work).parent / "runtime" / "rvc"
|
|
52
|
+
if (cand / "assets" / "weights").is_dir():
|
|
53
|
+
return cand
|
|
54
|
+
for legacy in (r"D:\AI\rvc", r"C:\rvc"):
|
|
55
|
+
if (Path(legacy) / "assets" / "weights").is_dir():
|
|
56
|
+
return Path(legacy)
|
|
57
|
+
return Path(work).parent / "runtime" / "rvc" if work else Path(r"D:\AI\rvc")
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
RVC_ROOT = _resolve_rvc_root()
|
|
37
61
|
# 自托管时 venv 和 rvc 代码是**平级**的(runtime/venv 与 runtime/rvc),不在 rvc/venv 里,
|
|
38
62
|
# 所以这个路径必须能被外部指定;回落到老结构(rvc/venv)只是为了兼容开发机。
|
|
39
63
|
RVC_PY = Path(os.environ.get(
|
|
@@ -43,7 +67,9 @@ RVC_PY = Path(os.environ.get(
|
|
|
43
67
|
SEP_PY = Path(os.environ.get("FISHSING_SEP_PY", sys.executable))
|
|
44
68
|
SEP_SCRIPT = Path(os.environ.get("FISHSING_SEP_SCRIPT",
|
|
45
69
|
str(Path(__file__).resolve().parent / "separate.py")))
|
|
46
|
-
FFMPEG = Path(os.environ.get("FISHSING_FFMPEG"
|
|
70
|
+
FFMPEG = Path(os.environ.get("FISHSING_FFMPEG")
|
|
71
|
+
or shutil.which("ffmpeg")
|
|
72
|
+
or r"D:\ffmpeg\bin\ffmpeg.exe")
|
|
47
73
|
|
|
48
74
|
DEFAULT_MODEL = os.environ.get("FISHSING_MODEL", "dfy2.pth")
|
|
49
75
|
DEFAULT_INDEX = os.environ.get(
|