from local

This commit is contained in:
dohe0342 2023-04-26 14:54:37 +09:00
parent 892cce0a1b
commit ee42fa7cb5
2 changed files with 8 additions and 0 deletions

View File

@ -80,7 +80,15 @@ class Transducer(nn.Module):
self.prompt = None
if prompt:
#self.prompt = torch.randn((200, 512), requires_grad=True)
statistic = open('/home/work/workspace/icefall/egs/librispeech/ASR/conv_feat/2094_statistic.txt', 'r').readlines()
self.prompt = torch.nn.Parameter(torch.rand((50, 512)))
print(self.prompt)
new_emb = torch.empty(512, 50)
for i in range(512):
mean, std = statistic[i].strip().split(' ')
new_emb[i] = torch.normal(float(mean), float(std), size=50).squeeze()
def forward(
self,