(self, texts, device)
| 504 | name=tokenizer_path, seq_len=text_len, clean='whitespace') |
| 505 | |
| 506 | def __call__(self, texts, device): |
| 507 | ids, mask = self.tokenizer( |
| 508 | texts, return_mask=True, add_special_tokens=True) |
| 509 | ids = ids.to(device) |
| 510 | mask = mask.to(device) |
| 511 | seq_lens = mask.gt(0).sum(dim=1).long() |
| 512 | context = self.model(ids, mask) |
| 513 | return [u[:v] for u, v in zip(context, seq_lens)] |
nothing calls this directly
no outgoing calls
no test coverage detected