paddlenlp/transformers/gpt/tokenizer.py
def vocab_size(self):
        """
        Returns the size of vocabulary.

        Returns:
            int: The size of vocabulary.

        Example:
            .. code-block::

                from paddlenlp.transformers import GPTChineseTokenizer
                tokenizer = GPTChineseTokenizer.from_pretrained('gpt-cpm-large-cn')
                print(tokenizer.vocab_size)
                # 50257

        """
        return len(self.sp)

        Returns the size of vocabulary.

        Returns:
            int: The size of vocabulary.

        Example:
            .. code-block::

                from paddlenlp.transformers import GPTChineseTokenizer
                tokenizer = GPTChineseTokenizer.from_pretrained('gpt-cpm-large-cn')
                print(tokenizer.vocab_size)
                # 50257

        
Returns the size of vocabulary.
Returns the size of vocabulary .
def vocab_size(self):
        return len(self.sp)
def vocab_size ( self ) : return len ( self . sp )
Returns the size of vocabulary.
Returns the size of vocabulary .
"""
        Returns the size of vocabulary.

        Returns:
            int: The size of vocabulary.

        Example:
            .. code-block::

                from paddlenlp.transformers import GPTChineseTokenizer
                tokenizer = GPTChineseTokenizer.from_pretrained('gpt-cpm-large-cn')
                print(tokenizer.vocab_size)
                # 50257

        """
The size of vocabulary.
The size of vocabulary .
int
self
examples
code-block:.

from paddlenlp.transformers import GPTChineseTokenizer
tokenizer = GPTChineseTokenizer.from_pretrained('gpt-cpm-large-cn')
print(tokenizer.vocab_size)
50257
code - block : . from paddlenlp . transformers import GPTChineseTokenizer tokenizer = GPTChineseTokenizer . from_pretrained ( ' gpt - cpm - large - cn ' ) print ( tokenizer . vocab_size ) 50257