def _fix_eos_on_preamble(self, input_ids: list[int]) -> list[int]:
        """If the input_ids is empty then input_ids will be a 0-length List.

        unless the tokenizer adds special tokens to empty strings (e.g. OPT
        tokenizer). If there is an EOS token added, we need to remove it so it
        is not in the middle of the prompt, as the specific eval question's
        prompt will follow the input_ids.

        Args:
            input_ids (List): The tokenized input

        Returns:
            input_ids: The tokenized input conditionally edited
        """
        if (
            self.tokenizer.eos_token_id is not None and len(input_ids) > 1 and
            input_ids[-1] == self.tokenizer.eos_token_id
        ):
            input_ids = input_ids[:-1]
        return input_ids
If the input_ids is empty then input_ids will be a 0-length List.

        unless the tokenizer adds special tokens to empty strings (e.g. OPT
        tokenizer). If there is an EOS token added, we need to remove it so it
        is not in the middle of the prompt, as the specific eval question's
        prompt will follow the input_ids.

        Args:
            input_ids (List): The tokenized input

        Returns:
            input_ids: The tokenized input conditionally edited
        
llmfoundry/eval/datasets/in_context_learning_evaluation.py