Spaces:
Running
Running
Commit
·
bed8775
1
Parent(s):
11646d7
Update svc_inference.py
Browse files- svc_inference.py +14 -6
svc_inference.py
CHANGED
@@ -135,20 +135,28 @@ def svc_infer(model, retrieval: IRetrieval, spk, pit, ppg, vec, hp, device):
|
|
135 |
|
136 |
|
137 |
def main(args):
|
138 |
-
|
139 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
140 |
print(
|
141 |
f"Auto run : python whisper/inference.py -w {args.wave} -p {args.ppg}")
|
142 |
os.system(f"python whisper/inference.py -w {args.wave} -p {args.ppg}")
|
143 |
|
144 |
-
if (
|
145 |
-
args.vec = "svc_tmp.vec.npy"
|
146 |
print(
|
147 |
f"Auto run : python hubert/inference.py -w {args.wave} -v {args.vec}")
|
148 |
os.system(f"python hubert/inference.py -w {args.wave} -v {args.vec}")
|
149 |
|
150 |
-
if (
|
151 |
-
args.pit = "svc_tmp.pit.csv"
|
152 |
print(
|
153 |
f"Auto run : python pitch/inference.py -w {args.wave} -p {args.pit}")
|
154 |
os.system(f"python pitch/inference.py -w {args.wave} -p {args.pit}")
|
|
|
135 |
|
136 |
|
137 |
def main(args):
|
138 |
+
temp_dir = "/tmp"
|
139 |
+
os.makedirs(temp_dir, exist_ok=True)
|
140 |
+
|
141 |
+
ppg_file = os.path.join(temp_dir, os.path.basename(args.wave) + ".ppg.npy")
|
142 |
+
vec_file = os.path.join(temp_dir, os.path.basename(args.wave) + ".vec.npy")
|
143 |
+
pit_file = os.path.join(temp_dir, os.path.basename(args.wave) + ".pit.csv")
|
144 |
+
|
145 |
+
args.ppg = ppg_file
|
146 |
+
args.vec = vec_file
|
147 |
+
args.pit = pit_file
|
148 |
+
|
149 |
+
if not os.path.exists(ppg_file):
|
150 |
print(
|
151 |
f"Auto run : python whisper/inference.py -w {args.wave} -p {args.ppg}")
|
152 |
os.system(f"python whisper/inference.py -w {args.wave} -p {args.ppg}")
|
153 |
|
154 |
+
if not os.path.exists(vec_file):
|
|
|
155 |
print(
|
156 |
f"Auto run : python hubert/inference.py -w {args.wave} -v {args.vec}")
|
157 |
os.system(f"python hubert/inference.py -w {args.wave} -v {args.vec}")
|
158 |
|
159 |
+
if not os.path.exists(pit_file):
|
|
|
160 |
print(
|
161 |
f"Auto run : python pitch/inference.py -w {args.wave} -p {args.pit}")
|
162 |
os.system(f"python pitch/inference.py -w {args.wave} -p {args.pit}")
|