examples/research_projects/onnx/summarization/bart_onnx/generation_onnx.py/BARTBeamSearchGenerator/adjust_logits_during_generation
class BARTBeamSearchGenerator:    def adjust_logits_during_generation(self, logits, cur_len: int, max_length: int):
        if cur_len == 1 and self.config.force_bos_token_to_be_generated:
            logits = self._force_token_id_to_be_generated(logits, self.config.bos_token_id)
        elif cur_len == max_length - 1 and self.config.eos_token_id is not None:
            logits = self._force_token_id_to_be_generated(logits, self.config.eos_token_id)
        return logits