(self, input_ids: torch.LongTensor, scores: torch.FloatTensor)
| 41 | self.stops = stops |
| 42 | |
| 43 | def __call__(self, input_ids: torch.LongTensor, scores: torch.FloatTensor): |
| 44 | for stop in self.stops: |
| 45 | if torch.all((stop == input_ids[:, -len(stop):])).item(): |
| 46 | return True |
| 47 | return False |
| 48 | |
| 49 | |
| 50 | def get_stopping_criteria(stop_words_ids): |
nothing calls this directly
no outgoing calls
no test coverage detected