


"""simple docstring"""






from typing import List, Optional, Tuple

from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import logging
from .tokenization_herbert import HerbertTokenizer


_lowerCAmelCase							:    str					   =	logging.get_logger(__name__)

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

_lowerCAmelCase							:    Optional[int]					   =	{
    '''vocab_file''': {
        '''allegro/herbert-base-cased''': '''https://huggingface.co/allegro/herbert-base-cased/resolve/main/vocab.json'''
    },
    '''merges_file''': {
        '''allegro/herbert-base-cased''': '''https://huggingface.co/allegro/herbert-base-cased/resolve/main/merges.txt'''
    },
}

_lowerCAmelCase							:    Union[str, Any]					   =	{'''allegro/herbert-base-cased''': 514}
_lowerCAmelCase							:    Any					   =	{}




class 							A_      (       _a ):
  lowerCAmelCase__      			=	VOCAB_FILES_NAMES
  lowerCAmelCase__      			=	PRETRAINED_VOCAB_FILES_MAP
  lowerCAmelCase__      			=	PRETRAINED_INIT_CONFIGURATION
  lowerCAmelCase__      			=	PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
  lowerCAmelCase__      			=	HerbertTokenizer


  def __init__(			self:						Dict							,__lowerCAmelCase:						int=None							,__lowerCAmelCase:						Any=None							,__lowerCAmelCase:						Dict=None							,__lowerCAmelCase:						Any="<s>"							,__lowerCAmelCase:						Dict="<unk>"							,__lowerCAmelCase:						str="<pad>"							,__lowerCAmelCase:						Optional[int]="<mask>"							,__lowerCAmelCase:						Union[str, Any]="</s>"							,**__lowerCAmelCase:						int							,):







     '''simple docstring'''







     super().__init__(
         __lowerCAmelCase							,__lowerCAmelCase							,tokenizer_file=__lowerCAmelCase							,cls_token=__lowerCAmelCase							,unk_token=__lowerCAmelCase							,pad_token=__lowerCAmelCase							,mask_token=__lowerCAmelCase							,sep_token=__lowerCAmelCase							,**__lowerCAmelCase							,)


  def 							_lowercase					(			self:						Union[str, Any]							,__lowerCAmelCase:						List[int]							,__lowerCAmelCase:						Optional[List[int]] = None    ):







     '''simple docstring'''







     _lowerCamelCase   :				List[Any]							=     [self.cls_token_id]
     _lowerCamelCase   :				Tuple							=     [self.sep_token_id]
     if token_ids_a is None:
        return cls + token_ids_a + sep

     return cls + token_ids_a + sep + token_ids_a + sep


  def 							_lowercase					(			self:						Optional[Any]							,__lowerCAmelCase:						List[int]							,__lowerCAmelCase:						Optional[List[int]] = None							,__lowerCAmelCase:						bool = False    ):







     '''simple docstring'''







     if already_has_special_tokens:
        return super().get_special_tokens_mask(
            token_ids_a=__lowerCAmelCase							,token_ids_a=__lowerCAmelCase							,already_has_special_tokens=__lowerCAmelCase    )

     if token_ids_a is None:
        return [1] + ([0] * len(__lowerCAmelCase    )) + [1]
     return [1] + ([0] * len(__lowerCAmelCase    )) + [1] + ([0] * len(__lowerCAmelCase    )) + [1]


  def 							_lowercase					(			self:						str							,__lowerCAmelCase:						List[int]							,__lowerCAmelCase:						Optional[List[int]] = None    ):







     '''simple docstring'''







     _lowerCamelCase   :				str							=     [self.sep_token_id]
     _lowerCamelCase   :				List[Any]							=     [self.cls_token_id]

     if token_ids_a is None:
        return len(cls + token_ids_a + sep    ) * [0]
     return len(cls + token_ids_a + sep    ) * [0] + len(token_ids_a + sep    ) * [1]






  def 							_lowercase					(			self:						Tuple							,__lowerCAmelCase:						str							,__lowerCAmelCase:						Optional[str] = None    ):







     '''simple docstring'''







     _lowerCamelCase   :				Tuple							=     self._tokenizer.model.save(__lowerCAmelCase							,name=__lowerCAmelCase    )
     return tuple(__lowerCAmelCase    )
'''simple docstring'''




# Copyright 2023 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from typing import TYPE_CHECKING

# rely on isort to merge the imports
from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available


__UpperCAmelCase					={
    "configuration_efficientnet": [
        "EFFICIENTNET_PRETRAINED_CONFIG_ARCHIVE_MAP",
        "EfficientNetConfig",
        "EfficientNetOnnxConfig",
    ]
}

try:
  if not is_vision_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  __UpperCAmelCase					=["EfficientNetImageProcessor"]

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  __UpperCAmelCase					=[
      "EFFICIENTNET_PRETRAINED_MODEL_ARCHIVE_LIST",
      "EfficientNetForImageClassification",
      "EfficientNetModel",
      "EfficientNetPreTrainedModel",
  ]

if TYPE_CHECKING:
  from .configuration_efficientnet import (
      EFFICIENTNET_PRETRAINED_CONFIG_ARCHIVE_MAP,
      EfficientNetConfig,
      EfficientNetOnnxConfig,
  )

  try:
    if not is_vision_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .image_processing_efficientnet import EfficientNetImageProcessor

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_efficientnet import (
        EFFICIENTNET_PRETRAINED_MODEL_ARCHIVE_LIST,
        EfficientNetForImageClassification,
        EfficientNetModel,
        EfficientNetPreTrainedModel,
    )

else:
  import sys

  __UpperCAmelCase					=_LazyModule(__name__, globals()["__file__"], _import_structure)
