


'''simple docstring'''



import inspect
import unittest

from transformers import is_torch_available, is_vision_available
from transformers.models.auto import get_values
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 transformers import MODEL_MAPPING, GLPNConfig, GLPNForDepthEstimation, GLPNModel
      from transformers.models.glpn.modeling_glpn import GLPN_PRETRAINED_MODEL_ARCHIVE_LIST


if is_vision_available():
      from PIL import Image

      from transformers import GLPNImageProcessor





class        UpperCAmelCase_  (_UpperCAmelCase  ):





    """simple docstring"""






    def 				lowercase_    (							self     )    ->					List[Any]:
         __lowerCamelCase       :     Optional[Any]        =		self.config_class(**self.inputs_dict     )
         self.parent.assertTrue(hasattr(SCREAMING_SNAKE_CASE_      ,					'hidden_sizes'     )     )
         self.parent.assertTrue(hasattr(SCREAMING_SNAKE_CASE_      ,					'num_attention_heads'     )     )
         self.parent.assertTrue(hasattr(SCREAMING_SNAKE_CASE_      ,					'num_encoder_blocks'     )     )







class        UpperCAmelCase_  :





    """simple docstring"""






    def __init__(							self      ,					SCREAMING_SNAKE_CASE_      ,					SCREAMING_SNAKE_CASE_=13      ,					SCREAMING_SNAKE_CASE_=64      ,					SCREAMING_SNAKE_CASE_=3      ,					SCREAMING_SNAKE_CASE_=4      ,					SCREAMING_SNAKE_CASE_=[2, 2, 2, 2]      ,					SCREAMING_SNAKE_CASE_=[8, 4, 2, 1]      ,					SCREAMING_SNAKE_CASE_=[16, 32, 64, 1_28]      ,					SCREAMING_SNAKE_CASE_=[1, 4, 8, 16]      ,					SCREAMING_SNAKE_CASE_=[1, 2, 4, 8]      ,					SCREAMING_SNAKE_CASE_=True      ,					SCREAMING_SNAKE_CASE_=True      ,					SCREAMING_SNAKE_CASE_="gelu"      ,					SCREAMING_SNAKE_CASE_=0.1      ,					SCREAMING_SNAKE_CASE_=0.1      ,					SCREAMING_SNAKE_CASE_=0.0_2      ,					SCREAMING_SNAKE_CASE_=16      ,					SCREAMING_SNAKE_CASE_=3      ,					SCREAMING_SNAKE_CASE_=None      ,					)    ->					int:
         __lowerCamelCase       :     Optional[Any]        =		parent
         __lowerCamelCase       :     int        =		batch_size
         __lowerCamelCase       :     List[Any]        =		image_size
         __lowerCamelCase       :     Union[str, Any]        =		num_channels
         __lowerCamelCase       :     List[str]        =		num_encoder_blocks
         __lowerCamelCase       :     int        =		sr_ratios
         __lowerCamelCase       :     List[Any]        =		depths
         __lowerCamelCase       :     List[str]        =		hidden_sizes
         __lowerCamelCase       :     Optional[int]        =		downsampling_rates
         __lowerCamelCase       :     Any        =		num_attention_heads
         __lowerCamelCase       :     Tuple        =		is_training
         __lowerCamelCase       :     List[Any]        =		use_labels
         __lowerCamelCase       :     List[Any]        =		hidden_act
         __lowerCamelCase       :     List[Any]        =		hidden_dropout_prob
         __lowerCamelCase       :     Tuple        =		attention_probs_dropout_prob
         __lowerCamelCase       :     List[str]        =		initializer_range
         __lowerCamelCase       :     Optional[Any]        =		decoder_hidden_size
         __lowerCamelCase       :     int        =		num_labels
         __lowerCamelCase       :     str        =		scope







    def 				lowercase_    (							self     )    ->					Union[str, Any]:
         __lowerCamelCase       :     Union[str, Any]        =		floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size]     )

         __lowerCamelCase       :     Dict        =		None
         if self.use_labels:
              __lowerCamelCase       :     Tuple        =		ids_tensor([self.batch_size, self.image_size, self.image_size]      ,					self.num_labels     )

         __lowerCamelCase       :     List[Any]        =		self.get_config()
         return config, pixel_values, labels







    def 				lowercase_    (							self     )    ->					Optional[Any]:
         return GLPNConfig(
             image_size=self.image_size      ,					num_channels=self.num_channels      ,					num_encoder_blocks=self.num_encoder_blocks      ,					depths=self.depths      ,					hidden_sizes=self.hidden_sizes      ,					num_attention_heads=self.num_attention_heads      ,					hidden_act=self.hidden_act      ,					hidden_dropout_prob=self.hidden_dropout_prob      ,					attention_probs_dropout_prob=self.attention_probs_dropout_prob      ,					initializer_range=self.initializer_range      ,					decoder_hidden_size=self.decoder_hidden_size      ,					)







    def 				lowercase_    (							self      ,					SCREAMING_SNAKE_CASE_      ,					SCREAMING_SNAKE_CASE_      ,					SCREAMING_SNAKE_CASE_     )    ->					str:
         __lowerCamelCase       :     Optional[int]        =		GLPNModel(config=SCREAMING_SNAKE_CASE_     )
         model.to(SCREAMING_SNAKE_CASE_     )
         model.eval()
         __lowerCamelCase       :     Optional[Any]        =		model(SCREAMING_SNAKE_CASE_     )
         __lowerCamelCase       :     Optional[Any]        =		self.image_size // (self.downsampling_rates[-1] * 2)
         self.parent.assertEqual(
             result.last_hidden_state.shape      ,					(self.batch_size, self.hidden_sizes[-1], expected_height, expected_width)     )







    def 				lowercase_    (							self      ,					SCREAMING_SNAKE_CASE_      ,					SCREAMING_SNAKE_CASE_      ,					SCREAMING_SNAKE_CASE_     )    ->					int:
         __lowerCamelCase       :     Dict        =		self.num_labels
         __lowerCamelCase       :     Optional[int]        =		GLPNForDepthEstimation(SCREAMING_SNAKE_CASE_     )
         model.to(SCREAMING_SNAKE_CASE_     )
         model.eval()
         __lowerCamelCase       :     Any        =		model(SCREAMING_SNAKE_CASE_     )
         self.parent.assertEqual(result.predicted_depth.shape      ,					(self.batch_size, self.image_size, self.image_size)     )
         __lowerCamelCase       :     List[str]        =		model(SCREAMING_SNAKE_CASE_      ,					labels=SCREAMING_SNAKE_CASE_     )
         self.parent.assertEqual(result.predicted_depth.shape      ,					(self.batch_size, self.image_size, self.image_size)     )







    def 				lowercase_    (							self     )    ->					Optional[Any]:
         __lowerCamelCase       :     Union[str, Any]        =		self.prepare_config_and_inputs()
         __lowerCamelCase    ,	__lowerCamelCase    ,	__lowerCamelCase       :     Union[str, Any]        =		config_and_inputs
         __lowerCamelCase       :     Dict        =		{'pixel_values': pixel_values}
         return config, inputs_dict







@require_torch
class        UpperCAmelCase_  (_UpperCAmelCase ,		_UpperCAmelCase ,		unittest.TestCase  ):





    """simple docstring"""






    lowerCamelCase  : Optional[int]												=      (GLPNModel, GLPNForDepthEstimation) if is_torch_available() else ()
    lowerCamelCase  : Optional[int]												=      (
        {'depth-estimation': GLPNForDepthEstimation, 'feature-extraction': GLPNModel} if is_torch_available() else {}
    )

    lowerCamelCase  : Optional[int]												=      False
    lowerCamelCase  : Optional[int]												=      False
    lowerCamelCase  : Optional[Any]												=      False







    def 				lowercase_    (							self     )    ->					Optional[int]:
         __lowerCamelCase       :     Optional[Any]        =		GLPNModelTester(self     )
         __lowerCamelCase       :     str        =		GLPNConfigTester(self      ,					config_class=SCREAMING_SNAKE_CASE_     )







    def 				lowercase_    (							self     )    ->					Optional[int]:
         self.config_tester.run_common_tests()







    def 				lowercase_    (							self     )    ->					List[Any]:
         __lowerCamelCase       :     List[Any]        =		self.model_tester.prepare_config_and_inputs()
         self.model_tester.create_and_check_model(*SCREAMING_SNAKE_CASE_     )







    def 				lowercase_    (							self     )    ->					List[Any]:
         __lowerCamelCase       :     Tuple        =		self.model_tester.prepare_config_and_inputs()
         self.model_tester.create_and_check_for_depth_estimation(*SCREAMING_SNAKE_CASE_     )







    @unittest.skip('GLPN does not use inputs_embeds'     )
    def 				lowercase_    (							self     )    ->					str:
         pass







    @unittest.skip('GLPN does not have get_input_embeddings method and get_output_embeddings methods'     )
    def 				lowercase_    (							self     )    ->					Optional[int]:
         pass







    def 				lowercase_    (							self     )    ->					Dict:
         __lowerCamelCase    ,	__lowerCamelCase       :     Optional[Any]        =		self.model_tester.prepare_config_and_inputs_for_common()

         for model_class in self.all_model_classes:
              __lowerCamelCase       :     Optional[Any]        =		model_class(SCREAMING_SNAKE_CASE_     )
              __lowerCamelCase       :     Dict        =		inspect.signature(model.forward     )
              # signature.parameters is an OrderedDict => so arg_names order is deterministic
              __lowerCamelCase       :     Optional[int]        =		[*signature.parameters.keys()]

              __lowerCamelCase       :     List[Any]        =		['pixel_values']
              self.assertListEqual(arg_names[:1]      ,					SCREAMING_SNAKE_CASE_     )







    def 				lowercase_    (							self     )    ->					Union[str, Any]:
         __lowerCamelCase    ,	__lowerCamelCase       :     Any        =		self.model_tester.prepare_config_and_inputs_for_common()
         __lowerCamelCase       :     Union[str, Any]        =		True

         for model_class in self.all_model_classes:
              __lowerCamelCase       :     Any        =		True
              __lowerCamelCase       :     Tuple        =		False
              __lowerCamelCase       :     Dict        =		True
              __lowerCamelCase       :     Optional[Any]        =		model_class(SCREAMING_SNAKE_CASE_     )
              model.to(SCREAMING_SNAKE_CASE_     )
              model.eval()
              with torch.no_grad():
                   __lowerCamelCase       :     List[Any]        =		model(**self._prepare_for_class(SCREAMING_SNAKE_CASE_      ,					SCREAMING_SNAKE_CASE_     )     )
              __lowerCamelCase       :     List[Any]        =		outputs.attentions

              __lowerCamelCase       :     str        =		sum(self.model_tester.depths     )
              self.assertEqual(len(SCREAMING_SNAKE_CASE_     )      ,					SCREAMING_SNAKE_CASE_     )

              # check that output_attentions also work using config
              del inputs_dict["output_attentions"]
              __lowerCamelCase       :     int        =		True
              __lowerCamelCase       :     Dict        =		model_class(SCREAMING_SNAKE_CASE_     )
              model.to(SCREAMING_SNAKE_CASE_     )
              model.eval()
              with torch.no_grad():
                   __lowerCamelCase       :     Optional[Any]        =		model(**self._prepare_for_class(SCREAMING_SNAKE_CASE_      ,					SCREAMING_SNAKE_CASE_     )     )
              __lowerCamelCase       :     Optional[int]        =		outputs.attentions

              self.assertEqual(len(SCREAMING_SNAKE_CASE_     )      ,					SCREAMING_SNAKE_CASE_     )

              # verify the first attentions (first block, first layer)
              __lowerCamelCase       :     Dict        =		(self.model_tester.image_size // 4) ** 2
              __lowerCamelCase       :     Any        =		(self.model_tester.image_size // (4 * self.model_tester.sr_ratios[0])) ** 2
              self.assertListEqual(
                  list(attentions[0].shape[-3:]     )      ,					[self.model_tester.num_attention_heads[0], expected_seq_len, expected_reduced_seq_len]      ,					)

              # verify the last attentions (last block, last layer)
              __lowerCamelCase       :     str        =		(self.model_tester.image_size // 32) ** 2
              __lowerCamelCase       :     Optional[int]        =		(self.model_tester.image_size // (32 * self.model_tester.sr_ratios[-1])) ** 2
              self.assertListEqual(
                  list(attentions[-1].shape[-3:]     )      ,					[self.model_tester.num_attention_heads[-1], expected_seq_len, expected_reduced_seq_len]      ,					)
              __lowerCamelCase       :     List[Any]        =		len(SCREAMING_SNAKE_CASE_     )

              # Check attention is always last and order is fine
              __lowerCamelCase       :     Tuple        =		True
              __lowerCamelCase       :     List[str]        =		True
              __lowerCamelCase       :     Tuple        =		model_class(SCREAMING_SNAKE_CASE_     )
              model.to(SCREAMING_SNAKE_CASE_     )
              model.eval()
              with torch.no_grad():
                   __lowerCamelCase       :     Tuple        =		model(**self._prepare_for_class(SCREAMING_SNAKE_CASE_      ,					SCREAMING_SNAKE_CASE_     )     )

              self.assertEqual(out_len + 1      ,					len(SCREAMING_SNAKE_CASE_     )     )

              __lowerCamelCase       :     Any        =		outputs.attentions

              self.assertEqual(len(SCREAMING_SNAKE_CASE_     )      ,					SCREAMING_SNAKE_CASE_     )
              # verify the first attentions (first block, first layer)
              __lowerCamelCase       :     Any        =		(self.model_tester.image_size // 4) ** 2
              __lowerCamelCase       :     List[str]        =		(self.model_tester.image_size // (4 * self.model_tester.sr_ratios[0])) ** 2
              self.assertListEqual(
                  list(self_attentions[0].shape[-3:]     )      ,					[self.model_tester.num_attention_heads[0], expected_seq_len, expected_reduced_seq_len]      ,					)







    def 				lowercase_    (							self     )    ->					Any:
         def check_hidden_states_output(SCREAMING_SNAKE_CASE_      ,					SCREAMING_SNAKE_CASE_      ,					SCREAMING_SNAKE_CASE_     ):
              __lowerCamelCase       :     Dict        =		model_class(SCREAMING_SNAKE_CASE_     )
              model.to(SCREAMING_SNAKE_CASE_     )
              model.eval()

              with torch.no_grad():
                   __lowerCamelCase       :     str        =		model(**self._prepare_for_class(SCREAMING_SNAKE_CASE_      ,					SCREAMING_SNAKE_CASE_     )     )

              __lowerCamelCase       :     List[str]        =		outputs.hidden_states

              __lowerCamelCase       :     Any        =		self.model_tester.num_encoder_blocks
              self.assertEqual(len(SCREAMING_SNAKE_CASE_     )      ,					SCREAMING_SNAKE_CASE_     )

              # verify the first hidden states (first block)
              self.assertListEqual(
                  list(hidden_states[0].shape[-3:]     )      ,					[
                      self.model_tester.hidden_sizes[0],
                      self.model_tester.image_size // 4,
                      self.model_tester.image_size // 4,
                  ]      ,					)

         __lowerCamelCase    ,	__lowerCamelCase       :     Dict        =		self.model_tester.prepare_config_and_inputs_for_common()

         for model_class in self.all_model_classes:
              __lowerCamelCase       :     Union[str, Any]        =		True
              check_hidden_states_output(SCREAMING_SNAKE_CASE_      ,					SCREAMING_SNAKE_CASE_      ,					SCREAMING_SNAKE_CASE_     )

              # check that output_hidden_states also work using config
              del inputs_dict["output_hidden_states"]
              __lowerCamelCase       :     Optional[int]        =		True

              check_hidden_states_output(SCREAMING_SNAKE_CASE_      ,					SCREAMING_SNAKE_CASE_      ,					SCREAMING_SNAKE_CASE_     )







    def 				lowercase_    (							self     )    ->					Optional[Any]:
         if not self.model_tester.is_training:
              return

         __lowerCamelCase    ,	__lowerCamelCase       :     Union[str, Any]        =		self.model_tester.prepare_config_and_inputs_for_common()
         __lowerCamelCase       :     Union[str, Any]        =		True

         for model_class in self.all_model_classes:
              if model_class in get_values(SCREAMING_SNAKE_CASE_     ):
                   continue
              # TODO: remove the following 3 lines once we have a MODEL_FOR_DEPTH_ESTIMATION_MAPPING
              # this can then be incorporated into _prepare_for_class in test_modeling_common.py
              if model_class.__name__ == "GLPNForDepthEstimation":
                   __lowerCamelCase    ,	__lowerCamelCase    ,	__lowerCamelCase    ,	__lowerCamelCase       :     List[str]        =		inputs_dict['pixel_values'].shape
                   __lowerCamelCase       :     Union[str, Any]        =		torch.zeros(
                       [self.model_tester.batch_size, height, width]      ,					device=SCREAMING_SNAKE_CASE_     ).long()
              __lowerCamelCase       :     Optional[Any]        =		model_class(SCREAMING_SNAKE_CASE_     )
              model.to(SCREAMING_SNAKE_CASE_     )
              model.train()
              __lowerCamelCase       :     Union[str, Any]        =		self._prepare_for_class(SCREAMING_SNAKE_CASE_      ,					SCREAMING_SNAKE_CASE_      ,					return_labels=SCREAMING_SNAKE_CASE_     )
              __lowerCamelCase       :     str        =		model(**SCREAMING_SNAKE_CASE_     ).loss
              loss.backward()







    @slow
    def 				lowercase_    (							self     )    ->					Optional[int]:
         for model_name in GLPN_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
              __lowerCamelCase       :     Dict        =		GLPNModel.from_pretrained(SCREAMING_SNAKE_CASE_     )
              self.assertIsNotNone(SCREAMING_SNAKE_CASE_     )







def       UpperCAmelCase__ (     )					->		List[Any]:
     __lowerCamelCase       :     Dict        =		Image.open('./tests/fixtures/tests_samples/COCO/000000039769.png'							)
     return image





@require_torch
@require_vision
@slow
class        UpperCAmelCase_  (unittest.TestCase  ):





    """simple docstring"""






    @slow
    def 				lowercase_    (							self     )    ->					Dict:
         __lowerCamelCase       :     Union[str, Any]        =		GLPNImageProcessor.from_pretrained(GLPN_PRETRAINED_MODEL_ARCHIVE_LIST[0]     )
         __lowerCamelCase       :     Optional[Any]        =		GLPNForDepthEstimation.from_pretrained(GLPN_PRETRAINED_MODEL_ARCHIVE_LIST[0]     ).to(SCREAMING_SNAKE_CASE_     )

         __lowerCamelCase       :     Optional[int]        =		prepare_img()
         __lowerCamelCase       :     Any        =		image_processor(images=SCREAMING_SNAKE_CASE_      ,					return_tensors='pt'     ).to(SCREAMING_SNAKE_CASE_     )

         # forward pass
         with torch.no_grad():
              __lowerCamelCase       :     str        =		model(**SCREAMING_SNAKE_CASE_     )

         # verify the predicted depth
         __lowerCamelCase       :     List[Any]        =		torch.Size([1, 4_80, 6_40]     )
         self.assertEqual(outputs.predicted_depth.shape      ,					SCREAMING_SNAKE_CASE_     )

         __lowerCamelCase       :     Tuple        =		torch.tensor(
             [[3.4_2_9_1, 2.7_8_6_5, 2.5_1_5_1], [3.2_8_4_1, 2.7_0_2_1, 2.3_5_0_2], [3.1_1_4_7, 2.4_6_2_5, 2.2_4_8_1]]     ).to(SCREAMING_SNAKE_CASE_     )

         self.assertTrue(torch.allclose(outputs.predicted_depth[0, :3, :3]      ,					SCREAMING_SNAKE_CASE_      ,					atol=1E-4     )     )










'''simple docstring'''



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


A__		: Optional[int]												=  logging.get_logger(__name__)

A__		: Optional[Any]												=  {"""vocab_file""": """vocab.json""", """merges_file""": """merges.txt""", """tokenizer_file""": """tokenizer.json"""}

A__		: Optional[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"""
        ),
    },
}

A__		: Any												=  {
    """openai/clip-vit-base-patch32""": 77,
}





class        UpperCAmelCase_  (_UpperCAmelCase  ):





    """simple docstring"""






    lowerCamelCase  : Union[str, Any]												=      VOCAB_FILES_NAMES
    lowerCamelCase  : Optional[int]												=      PRETRAINED_VOCAB_FILES_MAP
    lowerCamelCase  : str												=      PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
    lowerCamelCase  : Union[str, Any]												=      ['input_ids', 'attention_mask']
    lowerCamelCase  : Optional[Any]												=      CLIPTokenizer







    def __init__(							self      ,					SCREAMING_SNAKE_CASE_=None      ,					SCREAMING_SNAKE_CASE_=None      ,					SCREAMING_SNAKE_CASE_=None      ,					SCREAMING_SNAKE_CASE_="<|endoftext|>"      ,					SCREAMING_SNAKE_CASE_="<|startoftext|>"      ,					SCREAMING_SNAKE_CASE_="<|endoftext|>"      ,					SCREAMING_SNAKE_CASE_="<|endoftext|>"      ,					**SCREAMING_SNAKE_CASE_      ,					)    ->					Union[str, Any]:
         super().__init__(
             SCREAMING_SNAKE_CASE_      ,					SCREAMING_SNAKE_CASE_      ,					tokenizer_file=SCREAMING_SNAKE_CASE_      ,					unk_token=SCREAMING_SNAKE_CASE_      ,					bos_token=SCREAMING_SNAKE_CASE_      ,					eos_token=SCREAMING_SNAKE_CASE_      ,					pad_token=SCREAMING_SNAKE_CASE_      ,					**SCREAMING_SNAKE_CASE_      ,					)

         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 				lowercase_    (							self     )    ->					Optional[Any]:
         __lowerCamelCase       :     Union[str, Any]        =		self.backend_tokenizer.decode

         def new_decode_method(*SCREAMING_SNAKE_CASE_      ,					**SCREAMING_SNAKE_CASE_     ):
              __lowerCamelCase       :     int        =		orig_decode_method(*SCREAMING_SNAKE_CASE_      ,					**SCREAMING_SNAKE_CASE_     )
              __lowerCamelCase       :     List[str]        =		text.replace(self.backend_tokenizer.model.end_of_word_suffix      ,					' '     ).strip()
              return text

         __lowerCamelCase       :     Union[str, Any]        =		new_decode_method







    def 				lowercase_    (							self      ,					SCREAMING_SNAKE_CASE_      ,					SCREAMING_SNAKE_CASE_ = None     )    ->					List[int]:
         __lowerCamelCase       :     Optional[int]        =		[self.bos_token_id]
         __lowerCamelCase       :     Tuple        =		[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 				lowercase_    (							self      ,					SCREAMING_SNAKE_CASE_      ,					SCREAMING_SNAKE_CASE_ = None     )    ->					List[int]:
         __lowerCamelCase       :     Dict        =		[self.bos_token_id]
         __lowerCamelCase       :     Optional[Any]        =		[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 				lowercase_    (							self      ,					SCREAMING_SNAKE_CASE_      ,					SCREAMING_SNAKE_CASE_ = None     )    ->					Tuple[str]:
         __lowerCamelCase       :     int        =		self._tokenizer.model.save(SCREAMING_SNAKE_CASE_      ,					name=SCREAMING_SNAKE_CASE_     )
         return tuple(SCREAMING_SNAKE_CASE_     )






