(self, text)
| 73 | param.requires_grad = False |
| 74 | |
| 75 | def forward(self, text): |
| 76 | batch_encoding = self.tokenizer(text, truncation=True, max_length=self.max_length, return_length=True, |
| 77 | return_overflowing_tokens=False, padding="max_length", return_tensors="pt") |
| 78 | tokens = batch_encoding["input_ids"].to(self.device) |
| 79 | outputs = self.transformer(input_ids=tokens) |
| 80 | |
| 81 | z = outputs.last_hidden_state |
| 82 | return z |
| 83 | |
| 84 | def encode(self, text): |
| 85 | return self(text) |
nothing calls this directly
no outgoing calls
no test coverage detected