(self, input_texts: Union[str, List[str]])
| 445 | return np.array(mink_percent) |
| 446 | |
| 447 | def get_logits(self, input_texts: Union[str, List[str]]): |
| 448 | tokens = self.batch_encode(input_texts, max_seq_len=self.max_seq_len) |
| 449 | outputs = self.model(input_ids=tokens) |
| 450 | if isinstance(outputs, tuple): |
| 451 | # moe returns (hidden_states, moe_losses) |
| 452 | outputs = outputs[0] |
| 453 | return outputs, tokens |
| 454 | |
| 455 | def batch_encode(self, |
| 456 | input_texts: Union[str, List[str]], |
no test coverage detected