(self, ngram_size: int)
| 452 | """ |
| 453 | |
| 454 | def __init__(self, ngram_size: int): |
| 455 | if not isinstance(ngram_size, int) or ngram_size <= 0: |
| 456 | raise ValueError(f"`ngram_size` has to be a strictly positive integer, but is {ngram_size}") |
| 457 | self.ngram_size = ngram_size |
| 458 | |
| 459 | def __call__(self, input_ids: torch.LongTensor, scores: torch.FloatTensor) -> torch.FloatTensor: |
| 460 | num_batch_hypotheses = scores.shape[0] |
nothing calls this directly
no outgoing calls
no test coverage detected