Merge branch 'master' into dev
This commit is contained in:
11
style_gen.py
11
style_gen.py
@@ -19,12 +19,13 @@ device = torch.device(config.style_gen_config.device)
|
|||||||
inference.to(device)
|
inference.to(device)
|
||||||
|
|
||||||
|
|
||||||
def extract_style_vector(wav_path):
|
|
||||||
return inference(wav_path)
|
|
||||||
|
|
||||||
|
|
||||||
def save_style_vector(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"\nError occurred with file: {wav_path}")
|
||||||
|
print(e)
|
||||||
|
raise
|
||||||
np.save(f"{wav_path}.npy", style_vec) # `test.wav` -> `test.wav.npy`
|
np.save(f"{wav_path}.npy", style_vec) # `test.wav` -> `test.wav.npy`
|
||||||
return style_vec
|
return style_vec
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user