keep only embedding mean as spk embedding

This commit is contained in:
lyuxiang.lx
2024-07-10 00:21:56 +08:00
parent ee9e87b4d3
commit 6a3e44242a
2 changed files with 3 additions and 1 deletions

View File

@@ -53,6 +53,8 @@ def main(args):
if spk not in spk2embedding:
spk2embedding[spk] = []
spk2embedding[spk].append(embedding)
for k, v in spk2embedding.items():
spk2embedding[k] = torch.tensor(v).mean(dim=0, keepdim=True).tolist()
torch.save(utt2embedding, '{}/utt2embedding.pt'.format(args.dir))
torch.save(spk2embedding, '{}/spk2embedding.pt'.format(args.dir))