(self, input_ids, attention_mask)
| 31 | |
| 32 | @torch.no_grad() |
| 33 | def encode_text(self, input_ids, attention_mask): |
| 34 | text_encoder_output = self.multi_encoder.text_model( |
| 35 | input_ids=input_ids, |
| 36 | attention_mask=attention_mask |
| 37 | ) |
| 38 | text_embeds = text_encoder_output.last_hidden_state |
| 39 | return text_embeds # bs x ntoken x ch |
| 40 | |
| 41 | def forward(self, input_ids, attention_mask): |
| 42 | net_device = next(self.parameters()).device |