paddlenlp/transformers/ernie_ctm/tokenizer.py
def num_special_tokens_to_add(self, pair=False):
        """
        Returns the number of added tokens when encoding a sequence with special tokens.

        Note:
            This encodes inputs and checks the number of added tokens, and is therefore not efficient.
            Do not put this inside your training loop.

        Args:
            pair (bool, optional):
                Whether the input is a sequence pair or a single sequence.
                Defaults to `False` and the input is a single sequence.

        Returns:
            int: Number of tokens added to sequences.
        """
        if pair is True:
            return self.cls_num + 2
        else:
            return self.cls_num + 1

        Returns the number of added tokens when encoding a sequence with special tokens.

        Note:
            This encodes inputs and checks the number of added tokens, and is therefore not efficient.
            Do not put this inside your training loop.

        Args:
            pair (bool, optional):
                Whether the input is a sequence pair or a single sequence.
                Defaults to `False` and the input is a single sequence.

        Returns:
            int: Number of tokens added to sequences.
        
Returns the number of added tokens when encoding a sequence with special tokens.
Note:
This encodes inputs and checks the number of added tokens, and is therefore not efficient.
Do not put this inside your training loop.
Returns the number of added tokens when encoding a sequence with special tokens . Note : This encodes inputs and checks the number of added tokens and is therefore not efficient . Do not put this inside your training loop .
def num_special_tokens_to_add(self, pair=False):
        if pair is True:
            return self.cls_num + 2
        else:
            return self.cls_num + 1
def num_special_tokens_to_add ( self , pair = False ) : if pair is True : return self . cls_num + 2 else : return self . cls_num + 1
Returns the number of added tokens when encoding a sequence with special tokens.
Returns the number of added tokens when encoding a sequence with special tokens .
"""
        Returns the number of added tokens when encoding a sequence with special tokens.

        Note:
            This encodes inputs and checks the number of added tokens, and is therefore not efficient.
            Do not put this inside your training loop.

        Args:
            pair (bool, optional):
                Whether the input is a sequence pair or a single sequence.
                Defaults to `False` and the input is a single sequence.

        Returns:
            int: Number of tokens added to sequences.
        """
Number of tokens added to sequences.
Number of tokens added to sequences .
int
self
pair
Whether the input is a sequence pair or a single sequence.
Defaults to `False` and the input is a single sequence.
Whether the input is a sequence pair or a single sequence . Defaults to ` False ` and the input is a single sequence .