






'''simple docstring'''




from typing import Optional, Tuple, Union

import tensorflow as tf

from ...activations_tf import ACTaFN
from ...modeling_tf_outputs import (
    TFBaseModelOutputWithNoAttention,
    TFBaseModelOutputWithPoolingAndNoAttention,
    TFImageClassifierOutputWithNoAttention,
)
from ...modeling_tf_utils import TFPreTrainedModel, TFSequenceClassificationLoss, keras_serializable, unpack_inputs
from ...tf_utils import shape_list
from ...utils import add_code_sample_docstrings, add_start_docstrings, add_start_docstrings_to_model_forward, logging
from .configuration_resnet import ResNetConfig


lowerCamelCase_							      =      logging.get_logger(__name__)

# General docstring
lowerCamelCase_							      =      '''ResNetConfig'''

# Base docstring
lowerCamelCase_							      =      '''microsoft/resnet-50'''
lowerCamelCase_							      =      [1, 20_48, 7, 7]

# Image classification docstring
lowerCamelCase_							      =      '''microsoft/resnet-50'''
lowerCamelCase_							      =      '''tiger cat'''

lowerCamelCase_							      =      [
    '''microsoft/resnet-50''',
    # See all resnet models at https://huggingface.co/models?filter=resnet
]

class      _UpperCAmelCase    (  tf.keras.layers.Layer		):




   """simple docstring"""

   def __init__(	self				:			List[Any]   ,   __UpperCAmelCase				:			Dict   ,   __UpperCAmelCase				:			Dict = 3   ,   __UpperCAmelCase				:			Dict = 1   ,   __UpperCAmelCase				:			Union[str, Any] = "relu"   ,   **__UpperCAmelCase				:			Any	):





         '''simple docstring'''





         super().__init__(**__lowerCamelCase	)
         _A      =			kernel_size // 2
         _A      =			tf.keras.layers.ConvaD(
             __lowerCamelCase   ,   kernel_size=__lowerCamelCase   ,   strides=__lowerCamelCase   ,   padding="valid"   ,   use_bias=__lowerCamelCase   ,   name="convolution"	)
         # Use same default momentum and epsilon as PyTorch equivalent
         _A      =			tf.keras.layers.BatchNormalization(epsilon=1E-5   ,   momentum=0.9   ,   name="normalization"	)
         _A      =			ACTaFN[activation] if activation is not None else tf.keras.layers.Activation("linear"	)

   def 		lowerCAmelCase				(	self				:			List[Any]   ,   __UpperCAmelCase				:			List[Any]	):





         '''simple docstring'''





         _A      =			(self.pad_value, self.pad_value)
         _A      =			tf.pad(__lowerCamelCase   ,   [(0, 0), height_pad, width_pad, (0, 0)]	)
         _A      =			self.conv(__lowerCamelCase	)
         return hidden_state

   def 		lowerCAmelCase				(	self				:			str   ,   __UpperCAmelCase				:			Dict   ,   __UpperCAmelCase				:			Optional[Any] = False	):





         '''simple docstring'''





         _A      =			self.convolution(__lowerCamelCase	)
         _A      =			self.normalization(__lowerCamelCase   ,   training=__lowerCamelCase	)
         _A      =			self.activation(__lowerCamelCase	)
         return hidden_state





class      _UpperCAmelCase    (  tf.keras.layers.Layer		):




   """simple docstring"""

   def __init__(	self				:			Union[str, Any]   ,   __UpperCAmelCase				:			Union[str, Any]   ,   **__UpperCAmelCase				:			Tuple	):





         '''simple docstring'''





         super().__init__(**__lowerCamelCase	)
         _A      =			TFResNetConvLayer(
             config.embedding_size   ,   kernel_size=7   ,   stride=2   ,   activation=config.hidden_act   ,   name="embedder"   ,   )
         _A      =			tf.keras.layers.MaxPoolaD(pool_size=3   ,   strides=2   ,   padding="valid"   ,   name="pooler"	)
         _A      =			config.num_channels

   def 		lowerCAmelCase				(	self				:			List[str]   ,   __UpperCAmelCase				:			Optional[int]   ,   __UpperCAmelCase				:			List[str] = False	):





         '''simple docstring'''





         _A      =			shape_list(__lowerCamelCase	)
         if tf.executing_eagerly() and num_channels != self.num_channels:
               raise ValueError(
                   "Make sure that the channel dimension of the pixel values match with the one set in the configuration."	)
         _A      =			pixel_values
         _A      =			self.embedder(__lowerCamelCase	)
         _A      =			tf.pad(__lowerCamelCase   ,   [[0, 0], [1, 1], [1, 1], [0, 0]]	)
         _A      =			self.pooler(__lowerCamelCase	)
         return hidden_state





class      _UpperCAmelCase    (  tf.keras.layers.Layer		):




   """simple docstring"""

   def __init__(	self				:			Optional[int]   ,   __UpperCAmelCase				:			Dict   ,   __UpperCAmelCase				:			Union[str, Any] = 2   ,   **__UpperCAmelCase				:			Any	):





         '''simple docstring'''





         super().__init__(**__lowerCamelCase	)
         _A      =			tf.keras.layers.ConvaD(
             __lowerCamelCase   ,   kernel_size=1   ,   strides=__lowerCamelCase   ,   use_bias=__lowerCamelCase   ,   name="convolution"	)
         # Use same default momentum and epsilon as PyTorch equivalent
         _A      =			tf.keras.layers.BatchNormalization(epsilon=1E-5   ,   momentum=0.9   ,   name="normalization"	)

   def 		lowerCAmelCase				(	self				:			Dict   ,   __UpperCAmelCase				:			Optional[Any]   ,   __UpperCAmelCase				:			int = False	):





         '''simple docstring'''





         _A      =			x
         _A      =			self.convolution(__lowerCamelCase	)
         _A      =			self.normalization(__lowerCamelCase   ,   training=__lowerCamelCase	)
         return hidden_state





class      _UpperCAmelCase    (  tf.keras.layers.Layer		):




   """simple docstring"""

   def __init__(	self				:			List[str]   ,   __UpperCAmelCase				:			Dict   ,   __UpperCAmelCase				:			List[Any]   ,   __UpperCAmelCase				:			str = 1   ,   __UpperCAmelCase				:			List[str] = "relu"   ,   **__UpperCAmelCase				:			List[Any]	):





         '''simple docstring'''





         super().__init__(**__lowerCamelCase	)
         _A      =			in_channels != out_channels or stride != 1
         _A      =			TFResNetConvLayer(__lowerCamelCase   ,   stride=__lowerCamelCase   ,   name="layer.0"	)
         _A      =			TFResNetConvLayer(__lowerCamelCase   ,   activation=__lowerCamelCase   ,   name="layer.1"	)
         _A      =			(
             TFResNetShortCut(__lowerCamelCase   ,   stride=__lowerCamelCase   ,   name="shortcut"	)
             if should_apply_shortcut
             else tf.keras.layers.Activation("linear"   ,   name="shortcut"	)
         )
         _A      =			ACTaFN[activation]

   def 		lowerCAmelCase				(	self				:			str   ,   __UpperCAmelCase				:			Union[str, Any]   ,   __UpperCAmelCase				:			Tuple = False	):





         '''simple docstring'''





         _A      =			hidden_state
         _A      =			self.conva(__lowerCamelCase   ,   training=__lowerCamelCase	)
         _A      =			self.conva(__lowerCamelCase   ,   training=__lowerCamelCase	)
         _A      =			self.shortcut(__lowerCamelCase   ,   training=__lowerCamelCase	)
         hidden_state += residual
         _A      =			self.activation(__lowerCamelCase	)
         return hidden_state





class      _UpperCAmelCase    (  tf.keras.layers.Layer		):




   """simple docstring"""

   def __init__(	self				:			Any   ,   __UpperCAmelCase				:			Union[str, Any]   ,   __UpperCAmelCase				:			Any   ,   __UpperCAmelCase				:			Optional[Any] = 1   ,   __UpperCAmelCase				:			int = "relu"   ,   __UpperCAmelCase				:			int = 4   ,   **__UpperCAmelCase				:			Optional[Any]   ,   ):





         '''simple docstring'''





         super().__init__(**__lowerCamelCase	)
         _A      =			in_channels != out_channels or stride != 1
         _A      =			out_channels // reduction
         _A      =			TFResNetConvLayer(__lowerCamelCase   ,   kernel_size=1   ,   name="layer.0"	)
         _A      =			TFResNetConvLayer(__lowerCamelCase   ,   stride=__lowerCamelCase   ,   name="layer.1"	)
         _A      =			TFResNetConvLayer(__lowerCamelCase   ,   kernel_size=1   ,   activation=__lowerCamelCase   ,   name="layer.2"	)
         _A      =			(
             TFResNetShortCut(__lowerCamelCase   ,   stride=__lowerCamelCase   ,   name="shortcut"	)
             if should_apply_shortcut
             else tf.keras.layers.Activation("linear"   ,   name="shortcut"	)
         )
         _A      =			ACTaFN[activation]

   def 		lowerCAmelCase				(	self				:			Union[str, Any]   ,   __UpperCAmelCase				:			Optional[int]   ,   __UpperCAmelCase				:			List[Any] = False	):





         '''simple docstring'''





         _A      =			hidden_state
         _A      =			self.conva(__lowerCamelCase   ,   training=__lowerCamelCase	)
         _A      =			self.conva(__lowerCamelCase   ,   training=__lowerCamelCase	)
         _A      =			self.conva(__lowerCamelCase   ,   training=__lowerCamelCase	)
         _A      =			self.shortcut(__lowerCamelCase   ,   training=__lowerCamelCase	)
         hidden_state += residual
         _A      =			self.activation(__lowerCamelCase	)
         return hidden_state





class      _UpperCAmelCase    (  tf.keras.layers.Layer		):




   """simple docstring"""

   def __init__(	self				:			List[Any]   ,   __UpperCAmelCase				:			Any   ,   __UpperCAmelCase				:			Any   ,   __UpperCAmelCase				:			List[Any]   ,   __UpperCAmelCase				:			Tuple = 2   ,   __UpperCAmelCase				:			Dict = 2   ,   **__UpperCAmelCase				:			Union[str, Any]	):





         '''simple docstring'''





         super().__init__(**__lowerCamelCase	)

         _A      =			TFResNetBottleNeckLayer if config.layer_type == "bottleneck" else TFResNetBasicLayer

         _A      =			[layer(__lowerCamelCase   ,   __lowerCamelCase   ,   stride=__lowerCamelCase   ,   activation=config.hidden_act   ,   name="layers.0"	)]
         layers += [
             layer(__lowerCamelCase   ,   __lowerCamelCase   ,   activation=config.hidden_act   ,   name=f'''layers.{i + 1}'''	)
             for i in range(depth - 1	)
         ]
         _A      =			layers

   def 		lowerCAmelCase				(	self				:			Optional[Any]   ,   __UpperCAmelCase				:			Union[str, Any]   ,   __UpperCAmelCase				:			Any = False	):





         '''simple docstring'''





         for layer in self.stage_layers:
               _A      =			layer(__lowerCamelCase   ,   training=__lowerCamelCase	)
         return hidden_state





class      _UpperCAmelCase    (  tf.keras.layers.Layer		):




   """simple docstring"""

   def __init__(	self				:			Tuple   ,   __UpperCAmelCase				:			Tuple   ,   **__UpperCAmelCase				:			Union[str, Any]	):





         '''simple docstring'''





         super().__init__(**__lowerCamelCase	)
         # based on `downsample_in_first_stage` the first layer of the first stage may or may not downsample the input
         _A      =			[
             TFResNetStage(
                 __lowerCamelCase   ,   config.embedding_size   ,   config.hidden_sizes[0]   ,   stride=2 if config.downsample_in_first_stage else 1   ,   depth=config.depths[0]   ,   name="stages.0"   ,   )
         ]
         for i, (in_channels, out_channels, depth) in enumerate(
             zip(config.hidden_sizes   ,   config.hidden_sizes[1:]   ,   config.depths[1:]	)	):
               self.stages.append(TFResNetStage(__lowerCamelCase   ,   __lowerCamelCase   ,   __lowerCamelCase   ,   depth=__lowerCamelCase   ,   name=f'''stages.{i + 1}'''	)	)

   def 		lowerCAmelCase				(	self				:			Any   ,   __UpperCAmelCase				:			Optional[int]   ,   __UpperCAmelCase				:			Optional[Any] = False   ,   __UpperCAmelCase				:			str = True   ,   __UpperCAmelCase				:			int = False   ,   ):





         '''simple docstring'''





         _A      =			() if output_hidden_states else None

         for stage_module in self.stages:
               if output_hidden_states:
                     _A      =			hidden_states + (hidden_state,)

               _A      =			stage_module(__lowerCamelCase   ,   training=__lowerCamelCase	)

         if output_hidden_states:
               _A      =			hidden_states + (hidden_state,)

         if not return_dict:
               return tuple(v for v in [hidden_state, hidden_states] if v is not None	)

         return TFBaseModelOutputWithNoAttention(last_hidden_state=__lowerCamelCase   ,   hidden_states=__lowerCamelCase	)





class      _UpperCAmelCase    (  snake_case_		):




   """simple docstring"""

   snake_case					       =		ResNetConfig
   snake_case					       =		'''resnet'''
   snake_case					       =		'''pixel_values'''

   @property
   def 		lowerCAmelCase				(	self				:			Dict	):





         '''simple docstring'''





         return {"pixel_values": tf.TensorSpec(shape=(None, self.config.num_channels, 224, 224)   ,   dtype=tf.floataa	)}





lowerCamelCase_							      =      r'''\n    This model is a TensorFlow\n    [tf.keras.layers.Layer](https://www.tensorflow.org/api_docs/python/tf/keras/layers/Layer) sub-class. Use it as a\n    regular TensorFlow Module and refer to the TensorFlow documentation for all matter related to general usage and\n    behavior.\n\n    Parameters:\n        config ([`ResNetConfig`]): Model configuration class with all the parameters of the model.\n            Initializing with a config file does not load the weights associated with the model, only the\n            configuration. Check out the [`~TFPreTrainedModel.from_pretrained`] method to load the model weights.\n'''


lowerCamelCase_							      =      r'''\n    Args:\n        pixel_values (`tf.Tensor` of shape `(batch_size, num_channels, height, width)`):\n            Pixel values. Pixel values can be obtained using [`AutoImageProcessor`]. See\n            [`ConvNextImageProcessor.__call__`] for details.\n\n        output_hidden_states (`bool`, *optional*):\n            Whether or not to return the hidden states of all layers. See `hidden_states` under returned tensors for\n            more detail.\n        return_dict (`bool`, *optional*):\n            Whether or not to return a [`~utils.ModelOutput`] instead of a plain tuple.\n'''

@keras_serializable
class      _UpperCAmelCase    (  tf.keras.layers.Layer		):




   """simple docstring"""

   snake_case					       =		ResNetConfig

   def __init__(	self				:			Tuple   ,   __UpperCAmelCase				:			List[str]   ,   **__UpperCAmelCase				:			Optional[int]	):





         '''simple docstring'''





         super().__init__(**__lowerCamelCase	)
         _A      =			config
         _A      =			TFResNetEmbeddings(__lowerCamelCase   ,   name="embedder"	)
         _A      =			TFResNetEncoder(__lowerCamelCase   ,   name="encoder"	)
         _A      =			tf.keras.layers.GlobalAveragePoolingaD(keepdims=__lowerCamelCase	)

   @unpack_inputs
   def 		lowerCAmelCase				(	self				:			List[str]   ,   __UpperCAmelCase				:			Union[str, Any]   ,   __UpperCAmelCase				:			str = None   ,   __UpperCAmelCase				:			Dict = None   ,   __UpperCAmelCase				:			List[Any] = False   ,   ):





         '''simple docstring'''





         _A      =			(
             output_hidden_states if output_hidden_states is not None else self.config.output_hidden_states
         )
         _A      =			return_dict if return_dict is not None else self.config.use_return_dict

         # TF 2.0 image layers can't use NCHW format when running on CPU.
         # We transpose to NHWC format and then transpose back after the full forward pass.
         # (batch_size, num_channels, height, width) -> (batch_size, height, width, num_channels)
         _A      =			tf.transpose(__lowerCamelCase   ,   perm=[0, 2, 3, 1]	)
         _A      =			self.embedder(__lowerCamelCase   ,   training=__lowerCamelCase	)

         _A      =			self.encoder(
             __lowerCamelCase   ,   output_hidden_states=__lowerCamelCase   ,   return_dict=__lowerCamelCase   ,   training=__lowerCamelCase	)

         _A      =			encoder_outputs[0]

         _A      =			self.pooler(__lowerCamelCase	)

         # Transpose all the outputs to the NCHW format
         # (batch_size, height, width, num_channels) -> (batch_size, num_channels, height, width)
         _A      =			tf.transpose(__lowerCamelCase   ,   (0, 3, 1, 2)	)
         _A      =			tf.transpose(__lowerCamelCase   ,   (0, 3, 1, 2)	)
         _A      =			()
         for hidden_state in encoder_outputs[1:]:
               _A      =			hidden_states + tuple(tf.transpose(__lowerCamelCase   ,   (0, 3, 1, 2)	) for h in hidden_state	)

         if not return_dict:
               return (last_hidden_state, pooled_output) + hidden_states

         _A      =			hidden_states if output_hidden_states else None

         return TFBaseModelOutputWithPoolingAndNoAttention(
             last_hidden_state=__lowerCamelCase   ,   pooler_output=__lowerCamelCase   ,   hidden_states=__lowerCamelCase   ,   )





@add_start_docstrings(
    '''The bare ResNet model outputting raw features without any specific head on top.'''							,					snake_case_							,					)
class      _UpperCAmelCase    (  snake_case_		):




   """simple docstring"""

   def __init__(	self				:			List[str]   ,   __UpperCAmelCase				:			Union[str, Any]   ,   **__UpperCAmelCase				:			Optional[Any]	):





         '''simple docstring'''





         super().__init__(__lowerCamelCase   ,   **__lowerCamelCase	)
         _A      =			TFResNetMainLayer(config=__lowerCamelCase   ,   name="resnet"	)

   @add_start_docstrings_to_model_forward(__lowerCamelCase	)
   @add_code_sample_docstrings(
       checkpoint=_CHECKPOINT_FOR_DOC   ,   output_type=__lowerCamelCase   ,   config_class=_CONFIG_FOR_DOC   ,   modality="vision"   ,   expected_output=_EXPECTED_OUTPUT_SHAPE   ,   )
   @unpack_inputs
   def 		lowerCAmelCase				(	self				:			Optional[Any]   ,   __UpperCAmelCase				:			Tuple   ,   __UpperCAmelCase				:			Union[str, Any] = None   ,   __UpperCAmelCase				:			Dict = None   ,   __UpperCAmelCase				:			Optional[Any] = False   ,   ):





         '''simple docstring'''





         _A      =			(
             output_hidden_states if output_hidden_states is not None else self.config.output_hidden_states
         )
         _A      =			return_dict if return_dict is not None else self.config.use_return_dict

         _A      =			self.resnet(
             pixel_values=__lowerCamelCase   ,   output_hidden_states=__lowerCamelCase   ,   return_dict=__lowerCamelCase   ,   training=__lowerCamelCase   ,   )
         return resnet_outputs





@add_start_docstrings(
    '''\n    ResNet Model with an image classification head on top (a linear layer on top of the pooled features), e.g. for\n    ImageNet.\n    '''							,					snake_case_							,					)
class      _UpperCAmelCase    (  snake_case_							,					snake_case_		):




   """simple docstring"""

   def __init__(	self				:			List[Any]   ,   __UpperCAmelCase				:			Union[str, Any]   ,   **__UpperCAmelCase				:			Union[str, Any]	):





         '''simple docstring'''





         super().__init__(__lowerCamelCase   ,   **__lowerCamelCase	)
         _A      =			config.num_labels
         _A      =			TFResNetMainLayer(__lowerCamelCase   ,   name="resnet"	)
         # classification head
         _A      =			(
             tf.keras.layers.Dense(config.num_labels   ,   name="classifier.1"	)
             if config.num_labels > 0
             else tf.keras.layers.Activation("linear"   ,   name="classifier.1"	)
         )

   def 		lowerCAmelCase				(	self				:			Union[str, Any]   ,   __UpperCAmelCase				:			Optional[Any]	):





         '''simple docstring'''





         _A      =			tf.keras.layers.Flatten()(__lowerCamelCase	)
         _A      =			self.classifier_layer(__lowerCamelCase	)
         return logits

   @add_start_docstrings_to_model_forward(__lowerCamelCase	)
   @add_code_sample_docstrings(
       checkpoint=_IMAGE_CLASS_CHECKPOINT   ,   output_type=__lowerCamelCase   ,   config_class=_CONFIG_FOR_DOC   ,   expected_output=_IMAGE_CLASS_EXPECTED_OUTPUT   ,   )
   @unpack_inputs
   def 		lowerCAmelCase				(	self				:			List[str]   ,   __UpperCAmelCase				:			Any = None   ,   __UpperCAmelCase				:			List[Any] = None   ,   __UpperCAmelCase				:			Optional[Any] = None   ,   __UpperCAmelCase				:			int = None   ,   __UpperCAmelCase				:			Optional[int] = False   ,   ):





         '''simple docstring'''





         _A      =			return_dict if return_dict is not None else self.config.use_return_dict

         _A      =			self.resnet(
             __lowerCamelCase   ,   output_hidden_states=__lowerCamelCase   ,   return_dict=__lowerCamelCase   ,   training=__lowerCamelCase	)

         _A      =			outputs.pooler_output if return_dict else outputs[1]

         _A      =			self.classifier(__lowerCamelCase	)

         _A      =			None if labels is None else self.hf_compute_loss(__lowerCamelCase   ,   __lowerCamelCase	)

         if not return_dict:
               _A      =			(logits,) + outputs[2:]
               return (loss,) + output if loss is not None else output

         return TFImageClassifierOutputWithNoAttention(loss=__lowerCamelCase   ,   logits=__lowerCamelCase   ,   hidden_states=outputs.hidden_states	)













'''simple docstring'''




import os
from shutil import copyfile
from typing import Optional, Tuple

from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import is_sentencepiece_available, logging


if is_sentencepiece_available():
    from .tokenization_reformer import ReformerTokenizer
else:
    lowerCamelCase_							      =      None


lowerCamelCase_							      =      logging.get_logger(__name__)


lowerCamelCase_							      =      '''▁'''

lowerCamelCase_							      =      {'''vocab_file''': '''spiece.model''', '''tokenizer_file''': '''tokenizer.json'''}

lowerCamelCase_							      =      {
    '''vocab_file''': {
        '''google/reformer-crime-and-punishment''': (
            '''https://huggingface.co/google/reformer-crime-and-punishment/resolve/main/spiece.model'''
        )
    },
    '''tokenizer_file''': {
        '''google/reformer-crime-and-punishment''': (
            '''https://huggingface.co/google/reformer-crime-and-punishment/resolve/main/tokenizer.json'''
        )
    },
}

lowerCamelCase_							      =      {
    '''google/reformer-crime-and-punishment''': 52_42_88,
}

class      _UpperCAmelCase    (  snake_case_		):




   """simple docstring"""

   snake_case					       =		VOCAB_FILES_NAMES
   snake_case					       =		PRETRAINED_VOCAB_FILES_MAP
   snake_case					       =		PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
   snake_case					       =		['''input_ids''', '''attention_mask''']
   snake_case					       =		ReformerTokenizer

   def __init__(	self				:			List[str]   ,   __UpperCAmelCase				:			List[str]=None   ,   __UpperCAmelCase				:			Any=None   ,   __UpperCAmelCase				:			List[Any]="</s>"   ,   __UpperCAmelCase				:			Optional[Any]="<unk>"   ,   __UpperCAmelCase				:			List[Any]=[]   ,   **__UpperCAmelCase				:			int   ,   ):





         '''simple docstring'''





         super().__init__(
             __UpperCAmelCase   ,   tokenizer_file=__UpperCAmelCase   ,   eos_token=__UpperCAmelCase   ,   unk_token=__UpperCAmelCase   ,   additional_special_tokens=__UpperCAmelCase   ,   **__UpperCAmelCase   ,   )

         _A      =			vocab_file
         _A      =			False if not self.vocab_file else True

   def 		lowerCAmelCase				(	self				:			Any   ,   __UpperCAmelCase				:			str   ,   __UpperCAmelCase				:			Optional[str] = None	):





         '''simple docstring'''





         if not self.can_save_slow_tokenizer:
               raise ValueError(
                   "Your fast tokenizer does not have the necessary information to save the vocabulary for a slow "
                   "tokenizer."	)

         if not os.path.isdir(__UpperCAmelCase	):
               logger.error(f'''Vocabulary path ({save_directory}) should be a directory'''	)
               return
         _A      =			os.path.join(
             __UpperCAmelCase   ,   (filename_prefix + "-" if filename_prefix else "") + VOCAB_FILES_NAMES["vocab_file"]	)

         if os.path.abspath(self.vocab_file	) != os.path.abspath(__UpperCAmelCase	):
               copyfile(self.vocab_file   ,   __UpperCAmelCase	)

         return (out_vocab_file,)





