Skip to content

Commit 62aae0c

Browse files
authored
Merge pull request Plachtaa#66 from ordinary-dev/fix-output-path
Use os.path.basename to extract the file name
2 parents 1399efc + 0635a26 commit 62aae0c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

inference.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,8 +390,8 @@ def main(args):
390390
time_vc_end = time.time()
391391
print(f"RTF: {(time_vc_end - time_vc_start) / vc_wave.size(-1) * sr}")
392392

393-
source_name = source.split("/")[-1].split(".")[0]
394-
target_name = target_name.split("/")[-1].split(".")[0]
393+
source_name = os.path.basename(source).split(".")[0]
394+
target_name = os.path.basename(target_name).split(".")[0]
395395
os.makedirs(args.output, exist_ok=True)
396396
torchaudio.save(os.path.join(args.output, f"vc_{source_name}_{target_name}_{length_adjust}_{diffusion_steps}_{inference_cfg_rate}.wav"), vc_wave.cpu(), sr)
397397

0 commit comments

Comments
 (0)