Update
This commit is contained in:
15
emo_gen.py
15
emo_gen.py
@@ -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 生成完毕!")
|
||||
|
||||
Reference in New Issue
Block a user