From 3f7644b56ad51c3e09753a1ae7364a2b238d21de Mon Sep 17 00:00:00 2001 From: CNajm Date: Sun, 5 Nov 2023 22:41:25 -0800 Subject: [PATCH] Fix error in index file path (#1502) --- infer/modules/vc/modules.py | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/infer/modules/vc/modules.py b/infer/modules/vc/modules.py index 3e7cdbb..33b40f5 100644 --- a/infer/modules/vc/modules.py +++ b/infer/modules/vc/modules.py @@ -169,18 +169,17 @@ class VC: if self.hubert_model is None: self.hubert_model = load_hubert(self.config) - file_index = ( - ( - file_index.strip(" ") - .strip('"') - .strip("\n") - .strip('"') - .strip(" ") - .replace("trained", "added") - ) - if file_index != "" - else file_index2 - ) # 防止小白写错,自动帮他替换掉 + if file_index: + file_index = file_index.strip(" ") \ + .strip('"') \ + .strip("\n") \ + .strip('"') \ + .strip(" ") \ + .replace("trained", "added") + elif file_index2: + file_index = file_index2 + else: + file_index = "" # 防止小白写错,自动帮他替换掉 audio_opt = self.pipeline.pipeline( self.hubert_model,