From 0d79bdc481e83309f4339ab1ce7e350957b0b868 Mon Sep 17 00:00:00 2001 From: Daiki Arai Date: Fri, 5 Jan 2024 23:23:38 +0900 Subject: [PATCH] =?UTF-8?q?=E4=B8=A6=E5=88=97=E5=87=A6=E7=90=86=E4=B8=AD?= =?UTF-8?q?=E3=81=AE=E3=82=A8=E3=83=A9=E3=83=BC=E6=83=85=E5=A0=B1=E3=81=AE?= =?UTF-8?q?=E5=BC=B7=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- style_gen.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/style_gen.py b/style_gen.py index 778a6a4..745c6c3 100644 --- a/style_gen.py +++ b/style_gen.py @@ -19,12 +19,13 @@ device = torch.device(config.style_gen_config.device) inference.to(device) -def extract_style_vector(wav_path): - return inference(wav_path) - - def save_style_vector(wav_path): - style_vec = extract_style_vector(wav_path) + try: + style_vec = inference(wav_path) + except Exception as e: + print(f"\nIncluding any problems: {wav_path}") + print(e) + raise np.save(f"{wav_path}.npy", style_vec) # `test.wav` -> `test.wav.npy` return style_vec