import inspect
import unittest

from transformers import RegNetConfig
from transformers.file_utils import cached_property, is_torch_available, is_vision_available
from transformers.testing_utils import require_torch, require_vision, slow, torch_device

from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, floats_tensor, ids_tensor
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
			import torch
			from torch import nn

			from transformers import RegNetForImageClassification, RegNetModel
			from transformers.models.regnet.modeling_regnet import REGNET_PRETRAINED_MODEL_ARCHIVE_LIST


if is_vision_available():
			from PIL import Image

			from transformers import AutoImageProcessor







class a :
						"""simple docstring"""

						def __init__( self :     List[str]				,							lowerCamelCase__ :     Any				,							lowerCamelCase__ :     str=3				,							lowerCamelCase__ :     Any=32				,							lowerCamelCase__ :     Tuple=3				,							lowerCamelCase__ :     Union[str, Any]=10				,							lowerCamelCase__ :     str=[10, 20, 30, 40]				,							lowerCamelCase__ :     Tuple=[1, 1, 2, 1]				,							lowerCamelCase__ :     Union[str, Any]=True				,							lowerCamelCase__ :     List[Any]=True				,							lowerCamelCase__ :     Optional[int]="relu"				,							lowerCamelCase__ :     Optional[Any]=3				,							lowerCamelCase__ :     Optional[Any]=None				,							)    ->						Dict:
													"""simple docstring"""


													__lowercase      =    parent
													__lowercase      =    batch_size
													__lowercase      =    image_size
													__lowercase      =    num_channels
													__lowercase      =    embeddings_size
													__lowercase      =    hidden_sizes
													__lowercase      =    depths
													__lowercase      =    is_training
													__lowercase      =    use_labels
													__lowercase      =    hidden_act
													__lowercase      =    num_labels
													__lowercase      =    scope
													__lowercase      =    len(lowerCamelCase__				)






						def     UpperCAmelCase_      ( self :     List[str]				)    ->						Any:
													"""simple docstring"""


													__lowercase      =    floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size]				)

													__lowercase      =    None
													if self.use_labels:
																				__lowercase      =    ids_tensor([self.batch_size]				,							self.num_labels				)

													__lowercase      =    self.get_config()

													return config, pixel_values, labels






						def     UpperCAmelCase_      ( self :     Optional[int]				)    ->						int:
													"""simple docstring"""


													return RegNetConfig(
													    num_channels=self.num_channels				,							embeddings_size=self.embeddings_size				,							hidden_sizes=self.hidden_sizes				,							depths=self.depths				,							hidden_act=self.hidden_act				,							num_labels=self.num_labels				,							)






						def     UpperCAmelCase_      ( self :     Dict				,							lowerCamelCase__ :     Union[str, Any]				,							lowerCamelCase__ :     Optional[Any]				,							lowerCamelCase__ :     Any				)    ->						Optional[Any]:
													"""simple docstring"""


													__lowercase      =    RegNetModel(config=lowerCamelCase__				)
													model.to(lowerCamelCase__				)
													model.eval()
													__lowercase      =    model(lowerCamelCase__				)
													# expected last hidden states: B, C, H // 32, W // 32
													self.parent.assertEqual(
													    result.last_hidden_state.shape				,							(self.batch_size, self.hidden_sizes[-1], self.image_size // 32, self.image_size // 32)				,							)






						def     UpperCAmelCase_      ( self :     Dict				,							lowerCamelCase__ :     List[Any]				,							lowerCamelCase__ :     Optional[int]				,							lowerCamelCase__ :     Optional[int]				)    ->						Any:
													"""simple docstring"""


													__lowercase      =    self.num_labels
													__lowercase      =    RegNetForImageClassification(lowerCamelCase__				)
													model.to(lowerCamelCase__				)
													model.eval()
													__lowercase      =    model(lowerCamelCase__				,							labels=lowerCamelCase__				)
													self.parent.assertEqual(result.logits.shape				,							(self.batch_size, self.num_labels)				)






						def     UpperCAmelCase_      ( self :     List[Any]				)    ->						Any:
													"""simple docstring"""


													__lowercase      =    self.prepare_config_and_inputs()
													__lowercase     ,     __lowercase     ,     __lowercase      =    config_and_inputs
													__lowercase      =    {'''pixel_values''': pixel_values}
													return config, inputs_dict







@require_torch
class a (     __SCREAMING_SNAKE_CASE       ,						__SCREAMING_SNAKE_CASE       ,						unittest.TestCase  ):
						"""simple docstring"""

						UpperCamelCase_	:       Optional[Any]       	=		(RegNetModel, RegNetForImageClassification) if is_torch_available() else ()
						UpperCamelCase_	:       int       	=		(
						    {'feature-extraction': RegNetModel, 'image-classification': RegNetForImageClassification}
						    if is_torch_available()
						    else {}
						)

						UpperCamelCase_	:       Tuple       	=		False
						UpperCamelCase_	:       str       	=		False
						UpperCamelCase_	:       Dict       	=		False
						UpperCamelCase_	:       List[str]       	=		False






						def     UpperCAmelCase_      ( self :     Dict				)    ->						Optional[Any]:
													"""simple docstring"""


													__lowercase      =    RegNetModelTester(self				)
													__lowercase      =    ConfigTester(self				,							config_class=lowerCamelCase__				,							has_text_modality=lowerCamelCase__				)






						def     UpperCAmelCase_      ( self :     List[str]				)    ->						int:
													"""simple docstring"""


													self.create_and_test_config_common_properties()
													self.config_tester.create_and_test_config_to_json_string()
													self.config_tester.create_and_test_config_to_json_file()
													self.config_tester.create_and_test_config_from_and_save_pretrained()
													self.config_tester.create_and_test_config_with_num_labels()
													self.config_tester.check_config_can_be_init_without_params()
													self.config_tester.check_config_arguments_init()






						def     UpperCAmelCase_      ( self :     int				)    ->						Union[str, Any]:
													"""simple docstring"""


													return






						@unittest.skip(reason='''RegNet does not use inputs_embeds'''				)
						def     UpperCAmelCase_      ( self :     Optional[Any]				)    ->						Any:
													"""simple docstring"""


													pass






						@unittest.skip(reason='''RegNet does not support input and output embeddings'''				)
						def     UpperCAmelCase_      ( self :     int				)    ->						List[Any]:
													"""simple docstring"""


													pass






						def     UpperCAmelCase_      ( self :     int				)    ->						List[str]:
													"""simple docstring"""


													__lowercase     ,     __lowercase      =    self.model_tester.prepare_config_and_inputs_for_common()

													for model_class in self.all_model_classes:
																				__lowercase      =    model_class(lowerCamelCase__				)
																				__lowercase      =    inspect.signature(model.forward				)
																				# signature.parameters is an OrderedDict => so arg_names order is deterministic
																				__lowercase      =    [*signature.parameters.keys()]

																				__lowercase      =    ['''pixel_values''']
																				self.assertListEqual(arg_names[:1]				,							lowerCamelCase__				)






						def     UpperCAmelCase_      ( self :     int				)    ->						Dict:
													"""simple docstring"""


													__lowercase      =    self.model_tester.prepare_config_and_inputs()
													self.model_tester.create_and_check_model(*lowerCamelCase__				)






						def     UpperCAmelCase_      ( self :     List[str]				)    ->						List[Any]:
													"""simple docstring"""


													__lowercase     ,     __lowercase      =    self.model_tester.prepare_config_and_inputs_for_common()

													for model_class in self.all_model_classes:
																				__lowercase      =    model_class(config=lowerCamelCase__				)
																				for name, module in model.named_modules():
																											if isinstance(lowerCamelCase__				,							(nn.BatchNormad, nn.GroupNorm)				):
																																		self.assertTrue(
																																		    torch.all(module.weight == 1				)				,							msg=f'Parameter {name} of model {model_class} seems not properly initialized'				,							)
																																		self.assertTrue(
																																		    torch.all(module.bias == 0				)				,							msg=f'Parameter {name} of model {model_class} seems not properly initialized'				,							)






						def     UpperCAmelCase_      ( self :     Any				)    ->						Union[str, Any]:
													"""simple docstring"""


													def check_hidden_states_output(lowerCamelCase__ :     str				,							lowerCamelCase__ :     List[str]				,							lowerCamelCase__ :     List[Any]				):
																				__lowercase      =    model_class(lowerCamelCase__				)
																				model.to(lowerCamelCase__				)
																				model.eval()

																				with torch.no_grad():
																											__lowercase      =    model(**self._prepare_for_class(lowerCamelCase__				,							lowerCamelCase__				)				)

																				__lowercase      =    outputs.encoder_hidden_states if config.is_encoder_decoder else outputs.hidden_states

																				__lowercase      =    self.model_tester.num_stages
																				self.assertEqual(len(lowerCamelCase__				)				,							expected_num_stages + 1				)

																				# RegNet's feature maps are of shape (batch_size, num_channels, height, width)
																				self.assertListEqual(
																				    list(hidden_states[0].shape[-2:]				)				,							[self.model_tester.image_size // 2, self.model_tester.image_size // 2]				,							)

													__lowercase     ,     __lowercase      =    self.model_tester.prepare_config_and_inputs_for_common()
													__lowercase      =    ['''basic''', '''bottleneck''']
													for model_class in self.all_model_classes:
																				for layer_type in layers_type:
																											__lowercase      =    layer_type
																											__lowercase      =    True
																											check_hidden_states_output(lowerCamelCase__				,							lowerCamelCase__				,							lowerCamelCase__				)

																											# check that output_hidden_states also work using config
																											del inputs_dict["output_hidden_states"]
																											__lowercase      =    True

																											check_hidden_states_output(lowerCamelCase__				,							lowerCamelCase__				,							lowerCamelCase__				)






						def     UpperCAmelCase_      ( self :     Tuple				)    ->						Dict:
													"""simple docstring"""


													__lowercase      =    self.model_tester.prepare_config_and_inputs()
													self.model_tester.create_and_check_for_image_classification(*lowerCamelCase__				)






						@slow
						def     UpperCAmelCase_      ( self :     Dict				)    ->						List[Any]:
													"""simple docstring"""


													for model_name in REGNET_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
																				__lowercase      =    RegNetModel.from_pretrained(lowerCamelCase__				)
																				self.assertIsNotNone(lowerCamelCase__				)







def 		_A(       )    -> Union[str, Any]:
							'''simple docstring'''


							__lowercase      =    Image.open('''./tests/fixtures/tests_samples/COCO/000000039769.png'''				)
							return image







@require_torch
@require_vision
class a (     unittest.TestCase  ):
						"""simple docstring"""

						@cached_property
						def     UpperCAmelCase_      ( self :     Union[str, Any]				)    ->						List[Any]:
													"""simple docstring"""


													return (
													    AutoImageProcessor.from_pretrained(REGNET_PRETRAINED_MODEL_ARCHIVE_LIST[0]				)
													    if is_vision_available()
													    else None
													)






						@slow
						def     UpperCAmelCase_      ( self :     Any				)    ->						List[str]:
													"""simple docstring"""


													__lowercase      =    RegNetForImageClassification.from_pretrained(REGNET_PRETRAINED_MODEL_ARCHIVE_LIST[0]				).to(lowerCamelCase__				)

													__lowercase      =    self.default_image_processor
													__lowercase      =    prepare_img()
													__lowercase      =    image_processor(images=lowerCamelCase__				,							return_tensors='''pt'''				).to(lowerCamelCase__				)

													# forward pass
													with torch.no_grad():
																				__lowercase      =    model(**lowerCamelCase__				)

													# verify the logits
													__lowercase      =    torch.Size((1, 1_000)				)
													self.assertEqual(outputs.logits.shape				,							lowerCamelCase__				)

													__lowercase      =    torch.tensor([-0.4_1_8_0, -1.5_0_5_1, -3.4_8_3_6]				).to(lowerCamelCase__				)

													self.assertTrue(torch.allclose(outputs.logits[0, :3]				,							lowerCamelCase__				,							atol=1e-4				)				)












import os
import re
import warnings
from shutil import copyfile
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple

import sentencepiece as spm

from ...tokenization_utils import PreTrainedTokenizer


if TYPE_CHECKING:
			from ...tokenization_utils_base import TextInput
from ...utils import logging


UpperCAmelCase__				     = logging.get_logger(__name__)

UpperCAmelCase__				     = {"vocab_file": "spiece.model"}

UpperCAmelCase__				     = {
    "vocab_file": {
        "t5-small": "https://huggingface.co/t5-small/resolve/main/spiece.model",
        "t5-base": "https://huggingface.co/t5-base/resolve/main/spiece.model",
        "t5-large": "https://huggingface.co/t5-large/resolve/main/spiece.model",
        "t5-3b": "https://huggingface.co/t5-3b/resolve/main/spiece.model",
        "t5-11b": "https://huggingface.co/t5-11b/resolve/main/spiece.model",
    }
}


# TODO(PVP) - this should be removed in Transformers v5
UpperCAmelCase__				     = {
    "t5-small": 512,
    "t5-base": 512,
    "t5-large": 512,
    "t5-3b": 512,
    "t5-11b": 512,
}

UpperCAmelCase__				     = "▁"







class a (     __SCREAMING_SNAKE_CASE  ):
						"""simple docstring"""

						UpperCamelCase_	:       List[str]       	=		VOCAB_FILES_NAMES
						UpperCamelCase_	:       Any       	=		PRETRAINED_VOCAB_FILES_MAP
						UpperCamelCase_	:       int       	=		PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
						UpperCamelCase_	:       Optional[int]       	=		['input_ids', 'attention_mask']






						def __init__( self :     Optional[Any]				,							lowerCamelCase__ :     int				,							lowerCamelCase__ :     Optional[int]="</s>"				,							lowerCamelCase__ :     Optional[int]="<unk>"				,							lowerCamelCase__ :     Dict="<pad>"				,							lowerCamelCase__ :     Optional[int]=100				,							lowerCamelCase__ :     int=None				,							lowerCamelCase__ :     Optional[Dict[str, Any]] = None				,							lowerCamelCase__ :     int=True				,							**lowerCamelCase__ :     Optional[int]				,							)    ->						None:
													"""simple docstring"""


													if extra_ids > 0 and additional_special_tokens is None:
																				__lowercase      =    [f'<extra_id_{i}>' for i in range(lowerCamelCase__				)]
													elif extra_ids > 0 and additional_special_tokens is not None:
																				# Check that we have the right number of extra_id special tokens
																				__lowercase      =    len(set(filter(lambda lowerCamelCase__				: bool('''extra_id''' in str(lowerCamelCase__				)				)				,							lowerCamelCase__				)				)				)
																				if extra_tokens != extra_ids:
																											raise ValueError(
																											    f'Both extra_ids ({extra_ids}) and additional_special_tokens ({additional_special_tokens}) are'
																											    ''' provided to T5Tokenizer. In this case the additional_special_tokens must include the extra_ids'''
																											    ''' tokens'''				)
													if legacy:
																				logger.warning_once(
																				    f'You are using the legacy behaviour of the {self.__class__}. This means that tokens that come after special tokens will not be properly handled. We recommend you to'
																				    ''' read the related pull request available at https://github.com/huggingface/transformers/pull/24565'''				)

													__lowercase      =    legacy
													__lowercase      =    {} if sp_model_kwargs is None else sp_model_kwargs

													super().__init__(
													    eos_token=lowerCamelCase__				,							unk_token=lowerCamelCase__				,							pad_token=lowerCamelCase__				,							extra_ids=lowerCamelCase__				,							additional_special_tokens=lowerCamelCase__				,							sp_model_kwargs=self.sp_model_kwargs				,							legacy=lowerCamelCase__				,							**lowerCamelCase__				,							)

													__lowercase      =    vocab_file
													__lowercase      =    extra_ids

													__lowercase      =    spm.SentencePieceProcessor(**self.sp_model_kwargs				)
													self.sp_model.Load(lowerCamelCase__				)






						@staticmethod
						def     UpperCAmelCase_      ( lowerCamelCase__ :     int				,							lowerCamelCase__ :     Any				,							lowerCamelCase__ :     List[str]				)    ->						Optional[int]:
													"""simple docstring"""


													if pretrained_model_name_or_path in TaTokenizer.max_model_input_sizes:
																				__lowercase      =    TaTokenizer.max_model_input_sizes[pretrained_model_name_or_path]
																				if init_max_model_length is not None and init_max_model_length != max_model_length:
																											return init_max_model_length
																				elif init_max_model_length is None:
																											warnings.warn(
																											    '''This tokenizer was incorrectly instantiated with a model max length of'''
																											    f' {deprecated_max_model_length} which will be corrected in Transformers v5.\nFor now, this'
																											    ''' behavior is kept to avoid breaking backwards compatibility when padding/encoding with'''
																											    ''' `truncation is True`.\n- Be aware that you SHOULD NOT rely on'''
																											    f' {pretrained_model_name_or_path} automatically truncating your input to'
																											    f' {deprecated_max_model_length} when padding/encoding.\n- If you want to encode/pad to sequences'
																											    f' longer than {deprecated_max_model_length} you can either instantiate this tokenizer with'
																											    ''' `model_max_length` or pass `max_length` when encoding/padding.\n- To avoid this warning, please'''
																											    ''' instantiate this tokenizer with `model_max_length` set to your preferred value.'''				,							lowerCamelCase__				,							)

													return max_model_length






						@property
						def     UpperCAmelCase_      ( self :     Union[str, Any]				)    ->						int:
													"""simple docstring"""


													return self.sp_model.get_piece_size() + self._extra_ids






						def     UpperCAmelCase_      ( self :     int				)    ->						Dict:
													"""simple docstring"""


													__lowercase      =    {self.convert_ids_to_tokens(lowerCamelCase__				): i for i in range(self.vocab_size				)}
													vocab.update(self.added_tokens_encoder				)
													return vocab






						def     UpperCAmelCase_      ( self :     int				,							lowerCamelCase__ :     List[int]				,							lowerCamelCase__ :     Optional[List[int]] = None				,							lowerCamelCase__ :     bool = False				)    ->						List[int]:
													"""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__				)

													# normal case: some special tokens
													if token_ids_a is None:
																				return ([0] * len(lowerCamelCase__				)) + [1]
													return ([0] * len(lowerCamelCase__				)) + [1] + ([0] * len(lowerCamelCase__				)) + [1]






						def     UpperCAmelCase_      ( self :     Any				)    ->						int:
													"""simple docstring"""


													return list(
													    set(filter(lambda lowerCamelCase__				: bool(re.search(R'''<extra_id_\d+>'''				,							lowerCamelCase__				)				) is not None				,							self.additional_special_tokens				)				)				)






						def     UpperCAmelCase_      ( self :     Dict				)    ->						Optional[int]:
													"""simple docstring"""


													return [self._convert_token_to_id(lowerCamelCase__				) for token in self.get_sentinel_tokens()]






						def     UpperCAmelCase_      ( self :     int				,							lowerCamelCase__ :     List[int]				)    ->						List[int]:
													"""simple docstring"""


													if len(lowerCamelCase__				) > 0 and token_ids[-1] == self.eos_token_id:
																				warnings.warn(
																				    f'This sequence already has {self.eos_token}. In future versions this behavior may lead to duplicated'
																				    ''' eos tokens being added.'''				)
																				return token_ids
													else:
																				return token_ids + [self.eos_token_id]






						def     UpperCAmelCase_      ( self :     Tuple				,							lowerCamelCase__ :     List[int]				,							lowerCamelCase__ :     Optional[List[int]] = None				)    ->						List[int]:
													"""simple docstring"""


													__lowercase      =    [self.eos_token_id]

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






						def     UpperCAmelCase_      ( self :     Tuple				,							lowerCamelCase__ :     List[int]				,							lowerCamelCase__ :     Optional[List[int]] = None				)    ->						List[int]:
													"""simple docstring"""


													__lowercase      =    self._add_eos_if_not_present(lowerCamelCase__				)
													if token_ids_a is None:
																				return token_ids_a
													else:
																				__lowercase      =    self._add_eos_if_not_present(lowerCamelCase__				)
																				return token_ids_a + token_ids_a






						def __getstate__( self :     List[str]				)    ->						Optional[Any]:
													"""simple docstring"""


													__lowercase      =    self.__dict__.copy()
													__lowercase      =    None
													return state






						def __setstate__( self :     Union[str, Any]				,							lowerCamelCase__ :     Optional[Any]				)    ->						int:
													"""simple docstring"""


													__lowercase      =    d

													# for backward compatibility
													if not hasattr(self				,							'''sp_model_kwargs'''				):
																				__lowercase      =    {}

													__lowercase      =    spm.SentencePieceProcessor(**self.sp_model_kwargs				)
													self.sp_model.Load(self.vocab_file				)






						def     UpperCAmelCase_      ( self :     Union[str, Any]				,							lowerCamelCase__ :     "TextInput"				,							**lowerCamelCase__ :     Optional[Any]				)    ->						List[str]:
													"""simple docstring"""


													if not self.legacy:
																				__lowercase      =    SPIECE_UNDERLINE + text.replace(lowerCamelCase__				,							''' '''				)
													return super().tokenize(lowerCamelCase__				,							**lowerCamelCase__				)






						def     UpperCAmelCase_      ( self :     Dict				,							lowerCamelCase__ :     Tuple				,							**lowerCamelCase__ :     Tuple				)    ->						Dict:
													"""simple docstring"""


													if not self.legacy:
																				__lowercase      =    text.startswith(lowerCamelCase__				)
																				if is_first:
																											__lowercase      =    text[1:]

													__lowercase      =    self.sp_model.encode(lowerCamelCase__				,							out_type=lowerCamelCase__				)

													if not self.legacy and not is_first and not text.startswith(''' '''				) and tokens[0].startswith(lowerCamelCase__				):
																				__lowercase      =    ([tokens[0][1:]] if len(tokens[0]				) > 1 else []) + tokens[1:]
													return tokens






						def     UpperCAmelCase_      ( self :     Optional[Any]				,							lowerCamelCase__ :     Tuple				)    ->						str:
													"""simple docstring"""


													if token.startswith('''<extra_id_'''				):
																				__lowercase      =    re.match(R'''<extra_id_(\d+)>'''				,							lowerCamelCase__				)
																				__lowercase      =    int(match.group(1				)				)
																				return self.vocab_size - num - 1
													return self.sp_model.piece_to_id(lowerCamelCase__				)






						def     UpperCAmelCase_      ( self :     Dict				,							lowerCamelCase__ :     Optional[int]				)    ->						Any:
													"""simple docstring"""


													if index < self.sp_model.get_piece_size():
																				__lowercase      =    self.sp_model.IdToPiece(lowerCamelCase__				)
													else:
																				__lowercase      =    f'<extra_id_{self.vocab_size - 1 - index}>'
													return token






						def     UpperCAmelCase_      ( self :     Tuple				,							lowerCamelCase__ :     List[Any]				)    ->						Tuple:
													"""simple docstring"""


													__lowercase      =    []
													__lowercase      =    ''''''
													__lowercase      =    False
													for token in tokens:
																				# make sure that special tokens are not decoded using sentencepiece model
																				if token in self.all_special_tokens:
																											if not prev_is_special:
																																		out_string += " "
																											out_string += self.sp_model.decode(lowerCamelCase__				) + token
																											__lowercase      =    True
																											__lowercase      =    []
																				else:
																											current_sub_tokens.append(lowerCamelCase__				)
																											__lowercase      =    False
													out_string += self.sp_model.decode(lowerCamelCase__				)
													return out_string.strip()






						def     UpperCAmelCase_      ( self :     Tuple				,							lowerCamelCase__ :     str				,							lowerCamelCase__ :     Optional[str] = None				)    ->						Tuple[str]:
													"""simple docstring"""


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

													if os.path.abspath(self.vocab_file				) != os.path.abspath(lowerCamelCase__				) and os.path.isfile(self.vocab_file				):
																				copyfile(self.vocab_file				,							lowerCamelCase__				)
													elif not os.path.isfile(self.vocab_file				):
																				with open(lowerCamelCase__				,							'''wb'''				) as fi:
																											__lowercase      =    self.sp_model.serialized_model_proto()
																											fi.write(lowerCamelCase__				)

													return (out_vocab_file,)






