'''simple docstring'''


from typing import Optional, Tuple

from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import logging
from .tokenization_openai import OpenAIGPTTokenizer


snake_case__     :			Dict      			=  logging.get_logger(__name__)

snake_case__     :			int      			=  {'''vocab_file''': '''vocab.json''', '''merges_file''': '''merges.txt''', '''tokenizer_file''': '''tokenizer.json'''}

snake_case__     :			List[str]      			=  {
    '''vocab_file''': {'''openai-gpt''': '''https://huggingface.co/openai-gpt/resolve/main/vocab.json'''},
    '''merges_file''': {'''openai-gpt''': '''https://huggingface.co/openai-gpt/resolve/main/merges.txt'''},
    '''tokenizer_file''': {'''openai-gpt''': '''https://huggingface.co/openai-gpt/resolve/main/tokenizer.json'''},
}

snake_case__     :			int      			=  {
    '''openai-gpt''': 512,
}






class      __SCREAMING_SNAKE_CASE						(       lowerCamelCase_       ):







  '''simple docstring'''






  lowerCamelCase_		:List[str]						    =		VOCAB_FILES_NAMES
  lowerCamelCase_		:Union[str, Any]						    =		PRETRAINED_VOCAB_FILES_MAP
  lowerCamelCase_		:Tuple						    =		PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
  lowerCamelCase_		:Optional[int]						    =		['''input_ids''', '''attention_mask''']
  lowerCamelCase_		:Optional[int]						    =		OpenAIGPTTokenizer


  def __init__( self      ,		snake_case_=None      ,		snake_case_=None      ,		snake_case_=None      ,		snake_case_="<unk>"      ,		**snake_case_						):




       '''simple docstring'''

       super().__init__(snake_case_      ,		snake_case_      ,		tokenizer_file=snake_case_      ,		unk_token=snake_case_      ,		**snake_case_						)


  @property
  def _UpperCamelCase     ( self						):




       '''simple docstring'''

       return True






  def _UpperCamelCase     ( self      ,		snake_case_      ,		snake_case_ = None						):




       '''simple docstring'''

       UpperCAmelCase_							:   Union[str, Any]   =      self._tokenizer.model.save(snake_case_      ,		name=snake_case_						)
       return tuple(snake_case_						)







'''simple docstring'''


from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tokenizers_available, is_torch_available


snake_case__     :			int      			=  {
    '''configuration_markuplm''': ['''MARKUPLM_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''MarkupLMConfig'''],
    '''feature_extraction_markuplm''': ['''MarkupLMFeatureExtractor'''],
    '''processing_markuplm''': ['''MarkupLMProcessor'''],
    '''tokenization_markuplm''': ['''MarkupLMTokenizer'''],
}

try:
 if not is_tokenizers_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 snake_case__     :			List[str]      			=  ['''MarkupLMTokenizerFast''']

try:
 if not is_torch_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 snake_case__     :			Dict      			=  [
     '''MARKUPLM_PRETRAINED_MODEL_ARCHIVE_LIST''',
     '''MarkupLMForQuestionAnswering''',
     '''MarkupLMForSequenceClassification''',
     '''MarkupLMForTokenClassification''',
     '''MarkupLMModel''',
     '''MarkupLMPreTrainedModel''',
 ]


if TYPE_CHECKING:
 from .configuration_markuplm import MARKUPLM_PRETRAINED_CONFIG_ARCHIVE_MAP, MarkupLMConfig
 from .feature_extraction_markuplm import MarkupLMFeatureExtractor
 from .processing_markuplm import MarkupLMProcessor
 from .tokenization_markuplm import MarkupLMTokenizer

 try:
  if not is_tokenizers_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .tokenization_markuplm_fast import MarkupLMTokenizerFast

 try:
  if not is_torch_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_markuplm import (
      MARKUPLM_PRETRAINED_MODEL_ARCHIVE_LIST,
      MarkupLMForQuestionAnswering,
      MarkupLMForSequenceClassification,
      MarkupLMForTokenClassification,
      MarkupLMModel,
      MarkupLMPreTrainedModel,
  )


else:
 import sys

 snake_case__     :			Optional[Any]      			=  _LazyModule(__name__, globals()['''__file__'''], _import_structure)






