This commit is contained in:
Sihan Wang
2023-11-28 00:35:39 +08:00
parent badb12585a
commit 982ea7d440
3 changed files with 28 additions and 15 deletions

View File

@@ -105,19 +105,6 @@ def process_func(
return y
def get_emo(path):
wav, sr = librosa.load(path, 16000)
device = config.bert_gen_config.device
return process_func(
np.expand_dims(wav, 0).astype(np.float),
sr,
model,
processor,
device,
embeddings=True,
).squeeze(0)
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument(
@@ -160,4 +147,4 @@ if __name__ == "__main__":
emb = model(data.to(device))[0].detach().cpu().numpy()
np.save(emo_path, emb)
print("Emo vec 生成完毕!")
print("Emo vec 生成完毕!")