Implemented kv_cache "fix" (from 1f3c1b5f4a); guess I should find out why it's crashing DirectML backend

This commit is contained in:
mrq 2023-02-13 13:48:31 +00:00
parent b383222be2
commit 2427c98333

View File

@ -230,7 +230,7 @@ class LearnedPositionEmbeddings(nn.Module):
return self.emb(torch.arange(0, sl, device=x.device))
def get_fixed_embedding(self, ind, dev):
return self.emb(torch.tensor([ind], device=dev)).unsqueeze(0)
return self.emb(torch.arange(0, ind, device=dev))[ind-1:ind]
def build_hf_gpt_transformer(layers, model_dim, heads, max_mel_seq_len, max_text_seq_len, checkpointing):