src/transformers/models/tapas/tokenization_tapas.py/TapasTokenizer/_get_token_budget
class TapasTokenizer:    def _get_token_budget(self, question_tokens, max_length=None):
        """
        Computes the number of tokens left for the table after tokenizing a question, taking into account the max
        sequence length of the model.

        Args:
            question_tokens (:obj:`List[String]`):
                List of question tokens. Returns: :obj:`int`: the number of tokens left for the table, given the model
                max length.
        """
        return (max_length if max_length is not None else self.model_max_length) - self._question_encoding_cost(
            question_tokens
        )