from local

This commit is contained in:
dohe0342 2023-04-26 12:27:10 +09:00
parent 04c11b8fdb
commit fe3efe7f42
2 changed files with 3 additions and 0 deletions

View File

@ -501,6 +501,9 @@ class Data2VecAudioModel(BaseFairseqModel):
length += features.size()[1] length += features.size()[1]
conv_feat_all = torch.cat([conv_feat_all, features[i]]) conv_feat_all = torch.cat([conv_feat_all, features[i]])
randint = np.random.randint(10000)
np.save(conv_feat_all.cpu().numpy(), '/home/work/workspace/icefall/egs/librispeech/ASR/conv_feat/
prompt = prompt.expand((features.size()[0], prompt.size()[0], prompt.size()[1])) prompt = prompt.expand((features.size()[0], prompt.size()[0], prompt.size()[1]))
features = torch.cat([prompt, features], dim=1) features = torch.cat([prompt, features], dim=1)
prompt_padding_mask = torch.zeros(prompt.size()[0], prompt.size()[1]).type(torch.BoolTensor).to(features.device) prompt_padding_mask = torch.zeros(prompt.size()[0], prompt.size()[1]).type(torch.BoolTensor).to(features.device)