This commit is contained in:
cafeai 2022-12-02 01:23:47 +09:00
parent 138cb7bbed
commit b96eabfe2a
1 changed files with 1 additions and 1 deletions

View File

@ -570,7 +570,7 @@ class AspectDataset(torch.utils.data.Dataset):
input_ids = z
else:
for i, x in enumerate(input_ids):
input_ids[i] = [self.tokenizer.bos_token_id, *x, *np.full((self.max_length - len(x) - 1), self.tokenizer.eos_token_id)]
input_ids[i] = [self.tokenizer.bos_token_id, *x, *np.full((self.tokenizer.model_max_length - len(x) - 1), self.tokenizer.eos_token_id)]
if args.clip_penultimate:
input_ids = self.text_encoder.text_model.final_layer_norm(self.text_encoder(torch.asarray(input_ids).to(self.device), output_hidden_states=True)['hidden_states'][-2])
else: