mirror of
https://github.com/RVC-Project/Retrieval-based-Voice-Conversion-WebUI.git
synced 2026-01-20 11:00:23 +00:00
Apply Code Formatter Change
This commit is contained in:
committed by
github-actions[bot]
parent
2e56c5c600
commit
c14721d9c3
@@ -6,7 +6,19 @@ from fairseq import checkpoint_utils
|
||||
|
||||
|
||||
def get_index_path_from_model(sid):
|
||||
return next((f for f in [os.path.join(root, name) for root, dirs, files in os.walk(os.getenv("index_root"), topdown=False) for name in files if name.endswith(".index") and "trained" not in name] if sid.split(".")[0] in f), "")
|
||||
return next(
|
||||
(
|
||||
f
|
||||
for f in [
|
||||
os.path.join(root, name)
|
||||
for root, dirs, files in os.walk(os.getenv("index_root"), topdown=False)
|
||||
for name in files
|
||||
if name.endswith(".index") and "trained" not in name
|
||||
]
|
||||
if sid.split(".")[0] in f
|
||||
),
|
||||
"",
|
||||
)
|
||||
|
||||
|
||||
def load_hubert(config):
|
||||
@@ -21,8 +33,8 @@ def load_hubert(config):
|
||||
else:
|
||||
hubert_model = hubert_model.float()
|
||||
return hubert_model.eval()
|
||||
|
||||
|
||||
|
||||
|
||||
def load_audio(file, sr):
|
||||
try:
|
||||
# https://github.com/openai/whisper/blob/main/whisper/audio.py#L26
|
||||
@@ -39,4 +51,4 @@ def load_audio(file, sr):
|
||||
except Exception as e:
|
||||
raise RuntimeError(f"Failed to load audio: {e}")
|
||||
|
||||
return np.frombuffer(out, np.float32).flatten()
|
||||
return np.frombuffer(out, np.float32).flatten()
|
||||
|
||||
Reference in New Issue
Block a user