




from typing import List, Optional, Tuple

from tokenizers import pre_tokenizers

from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import logging
from .tokenization_clip import CLIPTokenizer


SCREAMING_SNAKE_CASE_						:					Optional[Any]			   =       logging.get_logger(__name__)

SCREAMING_SNAKE_CASE_						:					Any			   =       {'''vocab_file''': '''vocab.json''', '''merges_file''': '''merges.txt''', '''tokenizer_file''': '''tokenizer.json'''}

SCREAMING_SNAKE_CASE_						:					int			   =       {
    '''vocab_file''': {
        '''openai/clip-vit-base-patch32''': '''https://huggingface.co/openai/clip-vit-base-patch32/resolve/main/vocab.json''',
    },
    '''merges_file''': {
        '''openai/clip-vit-base-patch32''': '''https://huggingface.co/openai/clip-vit-base-patch32/resolve/main/merges.txt''',
    },
    '''tokenizer_file''': {
        '''openai/clip-vit-base-patch32''': (
            '''https://huggingface.co/openai/clip-vit-base-patch32/resolve/main/tokenizer.json'''
        ),
    },
}

SCREAMING_SNAKE_CASE_						:					Optional[Any]			   =       {
    '''openai/clip-vit-base-patch32''': 77,
}







class 		__UpperCAmelCase(		lowercase__ ):





     """simple docstring"""



     __UpperCAmelCase	: Any						=    VOCAB_FILES_NAMES
     __UpperCAmelCase	: List[str]						=    PRETRAINED_VOCAB_FILES_MAP
     __UpperCAmelCase	: Optional[Any]						=    PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
     __UpperCAmelCase	: Optional[int]						=    ["""input_ids""", """attention_mask"""]
     __UpperCAmelCase	: List[Any]						=    CLIPTokenizer

     def __init__(      self :       Union[str, Any]						,				A :       Dict=None						,				A :       List[Any]=None						,				A :       str=None						,				A :       Union[str, Any]="<|endoftext|>"						,				A :       Optional[Any]="<|startoftext|>"						,				A :       Any="<|endoftext|>"						,				A :       Any="<|endoftext|>"						,				**A :       str						,				)			->			List[Any]:






         """simple docstring"""
         super().__init__(
             A						,				A						,				tokenizer_file=A						,				unk_token=A						,				bos_token=A						,				eos_token=A						,				pad_token=A						,				**A						,				)

         if not isinstance(self.backend_tokenizer.pre_tokenizer						,				pre_tokenizers.Sequence    ):
             raise ValueError(
                 """The `backend_tokenizer` provided does not match the expected format. The CLIP tokenizer has been"""
                 """ heavily modified from transformers version 4.17.0. You need to convert the tokenizer you are using"""
                 """ to be compatible with this version.The easiest way to do so is"""
                 """ `CLIPTokenizerFast.from_pretrained(\"path_to_local_folder_or_hub_repo, from_slow=True)`. If you want"""
                 """ to use your existing tokenizer, you will have to revert to a version prior to 4.17.0 of"""
                 """ transformers."""    )

         self._wrap_decode_method_backend_tokenizer()

     def 				__SCREAMING_SNAKE_CASE		(      self :       List[Any]    )			->			Dict:






         """simple docstring"""
         a__      =       self.backend_tokenizer.decode

         def new_decode_method(*A :       List[Any]						,				**A :       Union[str, Any]    ):
             a__      =       orig_decode_method(*A						,				**A    )
             a__      =       text.replace(self.backend_tokenizer.model.end_of_word_suffix						,				""" """    ).strip()
             return text

         a__      =       new_decode_method

     def 				__SCREAMING_SNAKE_CASE		(      self :       Tuple						,				A :       List[int]						,				A :       Optional[List[int]] = None    )			->			List[int]:






         """simple docstring"""
         a__      =       [self.bos_token_id]
         a__      =       [self.eos_token_id]

         if token_ids_a is None:
             return bos_token + token_ids_a + eos_token
         return bos_token + token_ids_a + eos_token + eos_token + token_ids_a + eos_token

     def 				__SCREAMING_SNAKE_CASE		(      self :       List[str]						,				A :       List[int]						,				A :       Optional[List[int]] = None    )			->			List[int]:






         """simple docstring"""
         a__      =       [self.bos_token_id]
         a__      =       [self.eos_token_id]

         if token_ids_a is None:
             return len(bos_token + token_ids_a + eos_token    ) * [0]
         return len(bos_token + token_ids_a + eos_token + eos_token + token_ids_a + eos_token    ) * [0]






     def 				__SCREAMING_SNAKE_CASE		(      self :       Dict						,				A :       str						,				A :       Optional[str] = None    )			->			Tuple[str]:






         """simple docstring"""
         a__      =       self._tokenizer.model.save(A						,				name=A    )
         return tuple(A    )












from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


SCREAMING_SNAKE_CASE_						:					str			   =       {
    '''configuration_wav2vec2_conformer''': [
        '''WAV2VEC2_CONFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP''',
        '''Wav2Vec2ConformerConfig''',
    ],
}


try:
 if not is_torch_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 SCREAMING_SNAKE_CASE_						:					Optional[int]			   =       [
     '''WAV2VEC2_CONFORMER_PRETRAINED_MODEL_ARCHIVE_LIST''',
     '''Wav2Vec2ConformerForAudioFrameClassification''',
     '''Wav2Vec2ConformerForCTC''',
     '''Wav2Vec2ConformerForPreTraining''',
     '''Wav2Vec2ConformerForSequenceClassification''',
     '''Wav2Vec2ConformerForXVector''',
     '''Wav2Vec2ConformerModel''',
     '''Wav2Vec2ConformerPreTrainedModel''',
 ]

if TYPE_CHECKING:
 from .configuration_wavaveca_conformer import (
     WAV2VEC2_CONFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP,
     WavaVecaConformerConfig,
 )

 try:
  if not is_torch_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_wavaveca_conformer import (
      WAV2VEC2_CONFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
      WavaVecaConformerForAudioFrameClassification,
      WavaVecaConformerForCTC,
      WavaVecaConformerForPreTraining,
      WavaVecaConformerForSequenceClassification,
      WavaVecaConformerForXVector,
      WavaVecaConformerModel,
      WavaVecaConformerPreTrainedModel,
  )

else:
 import sys

 SCREAMING_SNAKE_CASE_						:					Optional[int]			   =       _LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)






