fix hidden states

This commit is contained in:
harubaru 2022-10-12 18:48:22 -07:00
parent f8bfa5f357
commit adbbc73e19
1 changed files with 1 additions and 1 deletions

View File

@ -154,7 +154,7 @@ class FrozenCLIPEmbedder(AbstractEncoder):
batch_encoding = self.tokenizer(text, truncation=True, max_length=self.max_length, return_length=True,
return_overflowing_tokens=False, padding="max_length", return_tensors="pt")
tokens = batch_encoding["input_ids"].to(self.device)
outputs = self.transformer(input_ids=tokens)
outputs = self.transformer(input_ids=tokens, output_hidden_states=True)
if self.penultimate:
z = outputs.hidden_states[-2] # simple enough