add vc code

This commit is contained in:
lyuxiang.lx
2024-09-26 10:49:22 +08:00
parent ed87445540
commit 49015f63e6
7 changed files with 43 additions and 216 deletions

View File

@@ -206,7 +206,7 @@ class TransformerLM(torch.nn.Module):
if top_ids == self.speech_token_size:
break
# in stream mode, yield token one by one
yield torch.tensor([[top_ids]], dtype=torch.int64, device=device)
yield top_ids
out_tokens.append(top_ids)
offset += lm_input.size(1)
lm_input = self.speech_embedding.weight[top_ids].reshape(1, 1, -1)