t_generated = [ ]
for j in range(nb_tokens):
- t = [ [ self.token2id[u] for u in t_primer + t_generated ] + [ 0 ] ]
+ t = [ [ self.token2id[u] for u in t_primer + t_generated ] ]
input = torch.tensor(t, device = self.device)
+ input = F.pad(input, (0, 1)) # Add the next token, the one to predict
output = model(input)
logits = output[0, -1]
if args.synthesis_sampling:
for j in range(nb_tokens):
input = self.tensorize([ t_primer + t_generated ]).to(self.device)
+ input = F.pad(input, (0, 1)) # Add the next token, the one to predict
output = model(input)
logits = output[0, -1]
if args.synthesis_sampling: