


'''simple docstring'''





import inspect
import unittest

from transformers import BitConfig
from transformers.testing_utils import require_torch, require_vision, slow, torch_device
from transformers.utils import cached_property, is_torch_available, is_vision_available

from ...test_backbone_common import BackboneTesterMixin
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 BitBackbone, BitForImageClassification, BitImageProcessor, BitModel
 from transformers.models.bit.modeling_bit import BIT_PRETRAINED_MODEL_ARCHIVE_LIST


if is_vision_available():
 from PIL import Image






class 	lowerCAmelCase_:
  '''simple docstring'''




  def __init__(   self  ,__UpperCAmelCase  ,__UpperCAmelCase=3  ,__UpperCAmelCase=32  ,__UpperCAmelCase=3  ,__UpperCAmelCase=10  ,__UpperCAmelCase=[8, 16, 32, 64]  ,__UpperCAmelCase=[1, 1, 2, 1]  ,__UpperCAmelCase=True  ,__UpperCAmelCase=True  ,__UpperCAmelCase="relu"  ,__UpperCAmelCase=3  ,__UpperCAmelCase=None  ,__UpperCAmelCase=["stage2", "stage3", "stage4"]  ,__UpperCAmelCase=[2, 3, 4]  ,__UpperCAmelCase=1  ,)   ->		List[Any]:
      lowerCAmelCase__			:  Optional[Any]											= parent
      lowerCAmelCase__			:  Optional[Any]											= batch_size
      lowerCAmelCase__			:  Tuple											= image_size
      lowerCAmelCase__			:  Optional[int]											= num_channels
      lowerCAmelCase__			:  List[Any]											= embeddings_size
      lowerCAmelCase__			:  Optional[Any]											= hidden_sizes
      lowerCAmelCase__			:  Any											= depths
      lowerCAmelCase__			:  int											= is_training
      lowerCAmelCase__			:  int											= use_labels
      lowerCAmelCase__			:  int											= hidden_act
      lowerCAmelCase__			:  Tuple											= num_labels
      lowerCAmelCase__			:  Union[str, Any]											= scope
      lowerCAmelCase__			:  Union[str, Any]											= len(_snake_case				)
      lowerCAmelCase__			:  str											= out_features
      lowerCAmelCase__			:  List[Any]											= out_indices
      lowerCAmelCase__			:  str											= num_groups




  def 							UpperCAmelCase_     (   self				)   ->		Optional[int]:
      lowerCAmelCase__			:  Optional[int]											= floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size]				)

      lowerCAmelCase__			:  int											= None
      if self.use_labels:
          lowerCAmelCase__			:  Optional[int]											= ids_tensor([self.batch_size]  ,self.num_labels				)

      lowerCAmelCase__			:  int											= self.get_config()

      return config, pixel_values, labels




  def 							UpperCAmelCase_     (   self				)   ->		Any:
      return BitConfig(
          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  ,out_features=self.out_features  ,out_indices=self.out_indices  ,num_groups=self.num_groups  ,)




  def 							UpperCAmelCase_     (   self  ,__UpperCAmelCase  ,__UpperCAmelCase  ,__UpperCAmelCase				)   ->		int:
      lowerCAmelCase__			:  Optional[int]											= BitModel(config=_snake_case				)
      model.to(_snake_case				)
      model.eval()
      lowerCAmelCase__			:  Any											= model(_snake_case				)
      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  ,__UpperCAmelCase  ,__UpperCAmelCase  ,__UpperCAmelCase				)   ->		Tuple:
      lowerCAmelCase__			:  Optional[Any]											= self.num_labels
      lowerCAmelCase__			:  Optional[int]											= BitForImageClassification(_snake_case				)
      model.to(_snake_case				)
      model.eval()
      lowerCAmelCase__			:  int											= model(_snake_case  ,labels=_snake_case				)
      self.parent.assertEqual(result.logits.shape  ,(self.batch_size, self.num_labels)				)




  def 							UpperCAmelCase_     (   self  ,__UpperCAmelCase  ,__UpperCAmelCase  ,__UpperCAmelCase				)   ->		List[str]:
      lowerCAmelCase__			:  Tuple											= BitBackbone(config=_snake_case				)
      model.to(_snake_case				)
      model.eval()
      lowerCAmelCase__			:  Any											= model(_snake_case				)

      # verify feature maps
      self.parent.assertEqual(len(result.feature_maps				)  ,len(config.out_features				)				)
      self.parent.assertListEqual(list(result.feature_maps[0].shape				)  ,[self.batch_size, self.hidden_sizes[1], 4, 4]				)

      # verify channels
      self.parent.assertEqual(len(model.channels				)  ,len(config.out_features				)				)
      self.parent.assertListEqual(model.channels  ,config.hidden_sizes[1:]				)

      # verify backbone works with out_features=None
      lowerCAmelCase__			:  Union[str, Any]											= None
      lowerCAmelCase__			:  Tuple											= BitBackbone(config=_snake_case				)
      model.to(_snake_case				)
      model.eval()
      lowerCAmelCase__			:  Optional[int]											= model(_snake_case				)

      # verify feature maps
      self.parent.assertEqual(len(result.feature_maps				)  ,1				)
      self.parent.assertListEqual(list(result.feature_maps[0].shape				)  ,[self.batch_size, self.hidden_sizes[-1], 1, 1]				)

      # verify channels
      self.parent.assertEqual(len(model.channels				)  ,1				)
      self.parent.assertListEqual(model.channels  ,[config.hidden_sizes[-1]]				)






  def 							UpperCAmelCase_     (   self				)   ->		str:
      lowerCAmelCase__			:  int											= self.prepare_config_and_inputs()
      lowerCAmelCase__				,       lowerCAmelCase__				,       lowerCAmelCase__			:  List[str]											= config_and_inputs
      lowerCAmelCase__			:  List[str]											= {"""pixel_values""": pixel_values}
      return config, inputs_dict







@require_torch
class 	lowerCAmelCase_(    SCREAMING_SNAKE_CASE_						,			SCREAMING_SNAKE_CASE_						,			unittest.TestCase					):
  '''simple docstring'''




  __lowercase							:				Dict           =				(BitModel, BitForImageClassification, BitBackbone) if is_torch_available() else ()
  __lowercase							:				Union[str, Any]           =				(
      {'''feature-extraction''': BitModel, '''image-classification''': BitForImageClassification}
      if is_torch_available()
      else {}
  )

  __lowercase							:				Dict           =				False
  __lowercase							:				Tuple           =				False
  __lowercase							:				Tuple           =				False
  __lowercase							:				Dict           =				False
  __lowercase							:				Any           =				False




  def 							UpperCAmelCase_     (   self				)   ->		List[Any]:
      lowerCAmelCase__			:  Optional[int]											= BitModelTester(self				)
      lowerCAmelCase__			:  Any											= ConfigTester(self  ,config_class=_snake_case  ,has_text_modality=_snake_case				)




  def 							UpperCAmelCase_     (   self				)   ->		Dict:
      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				)   ->		List[Any]:
      return




  @unittest.skip(reason="""Bit does not output attentions"""				)
  def 							UpperCAmelCase_     (   self				)   ->		Union[str, Any]:
      pass




  @unittest.skip(reason="""Bit does not use inputs_embeds"""				)
  def 							UpperCAmelCase_     (   self				)   ->		Any:
      pass




  @unittest.skip(reason="""Bit does not support input and output embeddings"""				)
  def 							UpperCAmelCase_     (   self				)   ->		Optional[int]:
      pass




  def 							UpperCAmelCase_     (   self				)   ->		Union[str, Any]:
      lowerCAmelCase__				,       lowerCAmelCase__			:  Any											= self.model_tester.prepare_config_and_inputs_for_common()

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

          lowerCAmelCase__			:  Tuple											= ["""pixel_values"""]
          self.assertListEqual(arg_names[:1]  ,_snake_case				)




  def 							UpperCAmelCase_     (   self				)   ->		List[Any]:
      lowerCAmelCase__			:  Any											= self.model_tester.prepare_config_and_inputs()
      self.model_tester.create_and_check_model(*_snake_case				)




  def 							UpperCAmelCase_     (   self				)   ->		List[str]:
      lowerCAmelCase__			:  Tuple											= self.model_tester.prepare_config_and_inputs()
      self.model_tester.create_and_check_backbone(*_snake_case				)




  def 							UpperCAmelCase_     (   self				)   ->		Optional[Any]:
      lowerCAmelCase__				,       lowerCAmelCase__			:  Any											= self.model_tester.prepare_config_and_inputs_for_common()

      for model_class in self.all_model_classes:
          lowerCAmelCase__			:  Optional[int]											= model_class(config=_snake_case				)
          for name, module in model.named_modules():
              if isinstance(_snake_case  ,(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				)   ->		Dict:


      def check_hidden_states_output(__UpperCAmelCase  ,__UpperCAmelCase  ,__UpperCAmelCase				):
          lowerCAmelCase__			:  Dict											= model_class(_snake_case				)
          model.to(_snake_case				)
          model.eval()

          with torch.no_grad():
              lowerCAmelCase__			:  Optional[int]											= model(**self._prepare_for_class(_snake_case  ,_snake_case				)				)

          lowerCAmelCase__			:  Dict											= outputs.encoder_hidden_states if config.is_encoder_decoder else outputs.hidden_states

          lowerCAmelCase__			:  List[str]											= self.model_tester.num_stages
          self.assertEqual(len(_snake_case				)  ,expected_num_stages + 1				)

          # Bit'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 // 4, self.model_tester.image_size // 4]  ,)

      lowerCAmelCase__				,       lowerCAmelCase__			:  int											= self.model_tester.prepare_config_and_inputs_for_common()
      lowerCAmelCase__			:  Tuple											= ["""preactivation""", """bottleneck"""]
      for model_class in self.all_model_classes:
          for layer_type in layers_type:
              lowerCAmelCase__			:  Tuple											= layer_type
              lowerCAmelCase__			:  Optional[Any]											= True
              check_hidden_states_output(_snake_case  ,_snake_case  ,_snake_case				)

              # check that output_hidden_states also work using config
              del inputs_dict["output_hidden_states"]
              lowerCAmelCase__			:  List[str]											= True

              check_hidden_states_output(_snake_case  ,_snake_case  ,_snake_case				)




  @unittest.skip(reason="""Bit does not use feedforward chunking"""				)
  def 							UpperCAmelCase_     (   self				)   ->		List[Any]:
      pass




  def 							UpperCAmelCase_     (   self				)   ->		List[Any]:
      lowerCAmelCase__			:  str											= self.model_tester.prepare_config_and_inputs()
      self.model_tester.create_and_check_for_image_classification(*_snake_case				)






  @slow
  def 							UpperCAmelCase_     (   self				)   ->		Optional[Any]:


      for model_name in BIT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
          lowerCAmelCase__			:  int											= BitModel.from_pretrained(_snake_case				)
          self.assertIsNotNone(_snake_case				)







def        _SCREAMING_SNAKE_CASE  (	):



    """simple docstring"""





    lowerCAmelCase__			:  int											= Image.open("""./tests/fixtures/tests_samples/COCO/000000039769.png"""      )
    return image






@require_torch
@require_vision
class 	lowerCAmelCase_(    unittest.TestCase					):
  '''simple docstring'''




  @cached_property
  def 							UpperCAmelCase_     (   self				)   ->		List[Any]:
      return (
          BitImageProcessor.from_pretrained(BIT_PRETRAINED_MODEL_ARCHIVE_LIST[0]				) if is_vision_available() else None
      )






  @slow
  def 							UpperCAmelCase_     (   self				)   ->		Dict:
      lowerCAmelCase__			:  int											= BitForImageClassification.from_pretrained(BIT_PRETRAINED_MODEL_ARCHIVE_LIST[0]				).to(_snake_case				)

      lowerCAmelCase__			:  List[Any]											= self.default_image_processor
      lowerCAmelCase__			:  Any											= prepare_img()
      lowerCAmelCase__			:  Dict											= image_processor(images=_snake_case  ,return_tensors="""pt"""				).to(_snake_case				)

      # forward pass
      with torch.no_grad():
          lowerCAmelCase__			:  List[str]											= model(**_snake_case				)

      # verify the logits
      lowerCAmelCase__			:  Union[str, Any]											= torch.Size((1, 1000)				)
      self.assertEqual(outputs.logits.shape  ,_snake_case				)

      lowerCAmelCase__			:  List[Any]											= torch.tensor([[-0.6_5_2_6, -0.5_2_6_3, -1.4_3_9_8]]				).to(_snake_case				)

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







@require_torch
class 	lowerCAmelCase_(    SCREAMING_SNAKE_CASE_						,			unittest.TestCase					):
  '''simple docstring'''




  __lowercase							:				Dict           =				(BitBackbone,) if is_torch_available() else ()
  __lowercase							:				List[str]           =				BitConfig

  __lowercase							:				int           =				False




  def 							UpperCAmelCase_     (   self				)   ->		Optional[Any]:
      lowerCAmelCase__			:  Union[str, Any]											= BitModelTester(self				)







'''simple docstring'''





from ..utils import DummyObject, requires_backends






class 	lowerCAmelCase_(    metaclass=SCREAMING_SNAKE_CASE_					):
  '''simple docstring'''




  __lowercase							:				int           =				['''sentencepiece''']




  def __init__(   self  ,*__UpperCAmelCase  ,**__UpperCAmelCase				)   ->		Optional[int]:
      requires_backends(self  ,["""sentencepiece"""]				)







class 	lowerCAmelCase_(    metaclass=SCREAMING_SNAKE_CASE_					):
  '''simple docstring'''




  __lowercase							:				Optional[Any]           =				['''sentencepiece''']




  def __init__(   self  ,*__UpperCAmelCase  ,**__UpperCAmelCase				)   ->		str:
      requires_backends(self  ,["""sentencepiece"""]				)







class 	lowerCAmelCase_(    metaclass=SCREAMING_SNAKE_CASE_					):
  '''simple docstring'''




  __lowercase							:				str           =				['''sentencepiece''']




  def __init__(   self  ,*__UpperCAmelCase  ,**__UpperCAmelCase				)   ->		Optional[Any]:
      requires_backends(self  ,["""sentencepiece"""]				)







class 	lowerCAmelCase_(    metaclass=SCREAMING_SNAKE_CASE_					):
  '''simple docstring'''




  __lowercase							:				Union[str, Any]           =				['''sentencepiece''']




  def __init__(   self  ,*__UpperCAmelCase  ,**__UpperCAmelCase				)   ->		List[Any]:
      requires_backends(self  ,["""sentencepiece"""]				)







class 	lowerCAmelCase_(    metaclass=SCREAMING_SNAKE_CASE_					):
  '''simple docstring'''




  __lowercase							:				int           =				['''sentencepiece''']




  def __init__(   self  ,*__UpperCAmelCase  ,**__UpperCAmelCase				)   ->		Tuple:
      requires_backends(self  ,["""sentencepiece"""]				)







class 	lowerCAmelCase_(    metaclass=SCREAMING_SNAKE_CASE_					):
  '''simple docstring'''




  __lowercase							:				Dict           =				['''sentencepiece''']




  def __init__(   self  ,*__UpperCAmelCase  ,**__UpperCAmelCase				)   ->		Dict:
      requires_backends(self  ,["""sentencepiece"""]				)







class 	lowerCAmelCase_(    metaclass=SCREAMING_SNAKE_CASE_					):
  '''simple docstring'''




  __lowercase							:				Optional[Any]           =				['''sentencepiece''']




  def __init__(   self  ,*__UpperCAmelCase  ,**__UpperCAmelCase				)   ->		List[str]:
      requires_backends(self  ,["""sentencepiece"""]				)







class 	lowerCAmelCase_(    metaclass=SCREAMING_SNAKE_CASE_					):
  '''simple docstring'''




  __lowercase							:				Optional[Any]           =				['''sentencepiece''']




  def __init__(   self  ,*__UpperCAmelCase  ,**__UpperCAmelCase				)   ->		List[Any]:
      requires_backends(self  ,["""sentencepiece"""]				)







class 	lowerCAmelCase_(    metaclass=SCREAMING_SNAKE_CASE_					):
  '''simple docstring'''




  __lowercase							:				Dict           =				['''sentencepiece''']




  def __init__(   self  ,*__UpperCAmelCase  ,**__UpperCAmelCase				)   ->		Any:
      requires_backends(self  ,["""sentencepiece"""]				)







class 	lowerCAmelCase_(    metaclass=SCREAMING_SNAKE_CASE_					):
  '''simple docstring'''




  __lowercase							:				Tuple           =				['''sentencepiece''']




  def __init__(   self  ,*__UpperCAmelCase  ,**__UpperCAmelCase				)   ->		Union[str, Any]:
      requires_backends(self  ,["""sentencepiece"""]				)







class 	lowerCAmelCase_(    metaclass=SCREAMING_SNAKE_CASE_					):
  '''simple docstring'''




  __lowercase							:				Optional[int]           =				['''sentencepiece''']




  def __init__(   self  ,*__UpperCAmelCase  ,**__UpperCAmelCase				)   ->		List[str]:
      requires_backends(self  ,["""sentencepiece"""]				)







class 	lowerCAmelCase_(    metaclass=SCREAMING_SNAKE_CASE_					):
  '''simple docstring'''




  __lowercase							:				Optional[Any]           =				['''sentencepiece''']




  def __init__(   self  ,*__UpperCAmelCase  ,**__UpperCAmelCase				)   ->		Union[str, Any]:
      requires_backends(self  ,["""sentencepiece"""]				)







class 	lowerCAmelCase_(    metaclass=SCREAMING_SNAKE_CASE_					):
  '''simple docstring'''




  __lowercase							:				Optional[int]           =				['''sentencepiece''']




  def __init__(   self  ,*__UpperCAmelCase  ,**__UpperCAmelCase				)   ->		List[str]:
      requires_backends(self  ,["""sentencepiece"""]				)







class 	lowerCAmelCase_(    metaclass=SCREAMING_SNAKE_CASE_					):
  '''simple docstring'''




  __lowercase							:				List[str]           =				['''sentencepiece''']




  def __init__(   self  ,*__UpperCAmelCase  ,**__UpperCAmelCase				)   ->		Any:
      requires_backends(self  ,["""sentencepiece"""]				)







class 	lowerCAmelCase_(    metaclass=SCREAMING_SNAKE_CASE_					):
  '''simple docstring'''




  __lowercase							:				Tuple           =				['''sentencepiece''']




  def __init__(   self  ,*__UpperCAmelCase  ,**__UpperCAmelCase				)   ->		List[str]:
      requires_backends(self  ,["""sentencepiece"""]				)







class 	lowerCAmelCase_(    metaclass=SCREAMING_SNAKE_CASE_					):
  '''simple docstring'''




  __lowercase							:				Dict           =				['''sentencepiece''']




  def __init__(   self  ,*__UpperCAmelCase  ,**__UpperCAmelCase				)   ->		List[Any]:
      requires_backends(self  ,["""sentencepiece"""]				)







class 	lowerCAmelCase_(    metaclass=SCREAMING_SNAKE_CASE_					):
  '''simple docstring'''




  __lowercase							:				Union[str, Any]           =				['''sentencepiece''']




  def __init__(   self  ,*__UpperCAmelCase  ,**__UpperCAmelCase				)   ->		List[Any]:
      requires_backends(self  ,["""sentencepiece"""]				)







class 	lowerCAmelCase_(    metaclass=SCREAMING_SNAKE_CASE_					):
  '''simple docstring'''




  __lowercase							:				Tuple           =				['''sentencepiece''']




  def __init__(   self  ,*__UpperCAmelCase  ,**__UpperCAmelCase				)   ->		str:
      requires_backends(self  ,["""sentencepiece"""]				)







class 	lowerCAmelCase_(    metaclass=SCREAMING_SNAKE_CASE_					):
  '''simple docstring'''




  __lowercase							:				List[Any]           =				['''sentencepiece''']




  def __init__(   self  ,*__UpperCAmelCase  ,**__UpperCAmelCase				)   ->		Optional[int]:
      requires_backends(self  ,["""sentencepiece"""]				)







class 	lowerCAmelCase_(    metaclass=SCREAMING_SNAKE_CASE_					):
  '''simple docstring'''




  __lowercase							:				int           =				['''sentencepiece''']




  def __init__(   self  ,*__UpperCAmelCase  ,**__UpperCAmelCase				)   ->		Optional[Any]:
      requires_backends(self  ,["""sentencepiece"""]				)







class 	lowerCAmelCase_(    metaclass=SCREAMING_SNAKE_CASE_					):
  '''simple docstring'''




  __lowercase							:				Tuple           =				['''sentencepiece''']




  def __init__(   self  ,*__UpperCAmelCase  ,**__UpperCAmelCase				)   ->		Dict:
      requires_backends(self  ,["""sentencepiece"""]				)







class 	lowerCAmelCase_(    metaclass=SCREAMING_SNAKE_CASE_					):
  '''simple docstring'''




  __lowercase							:				str           =				['''sentencepiece''']




  def __init__(   self  ,*__UpperCAmelCase  ,**__UpperCAmelCase				)   ->		List[Any]:
      requires_backends(self  ,["""sentencepiece"""]				)







class 	lowerCAmelCase_(    metaclass=SCREAMING_SNAKE_CASE_					):
  '''simple docstring'''




  __lowercase							:				Union[str, Any]           =				['''sentencepiece''']




  def __init__(   self  ,*__UpperCAmelCase  ,**__UpperCAmelCase				)   ->		List[Any]:
      requires_backends(self  ,["""sentencepiece"""]				)







class 	lowerCAmelCase_(    metaclass=SCREAMING_SNAKE_CASE_					):
  '''simple docstring'''




  __lowercase							:				List[str]           =				['''sentencepiece''']




  def __init__(   self  ,*__UpperCAmelCase  ,**__UpperCAmelCase				)   ->		Any:
      requires_backends(self  ,["""sentencepiece"""]				)







class 	lowerCAmelCase_(    metaclass=SCREAMING_SNAKE_CASE_					):
  '''simple docstring'''




  __lowercase							:				Optional[Any]           =				['''sentencepiece''']




  def __init__(   self  ,*__UpperCAmelCase  ,**__UpperCAmelCase				)   ->		Optional[Any]:
      requires_backends(self  ,["""sentencepiece"""]				)







class 	lowerCAmelCase_(    metaclass=SCREAMING_SNAKE_CASE_					):
  '''simple docstring'''




  __lowercase							:				Optional[int]           =				['''sentencepiece''']




  def __init__(   self  ,*__UpperCAmelCase  ,**__UpperCAmelCase				)   ->		str:
      requires_backends(self  ,["""sentencepiece"""]				)







class 	lowerCAmelCase_(    metaclass=SCREAMING_SNAKE_CASE_					):
  '''simple docstring'''




  __lowercase							:				Any           =				['''sentencepiece''']




  def __init__(   self  ,*__UpperCAmelCase  ,**__UpperCAmelCase				)   ->		int:
      requires_backends(self  ,["""sentencepiece"""]				)







class 	lowerCAmelCase_(    metaclass=SCREAMING_SNAKE_CASE_					):
  '''simple docstring'''




  __lowercase							:				List[Any]           =				['''sentencepiece''']




  def __init__(   self  ,*__UpperCAmelCase  ,**__UpperCAmelCase				)   ->		List[str]:
      requires_backends(self  ,["""sentencepiece"""]				)







class 	lowerCAmelCase_(    metaclass=SCREAMING_SNAKE_CASE_					):
  '''simple docstring'''




  __lowercase							:				Tuple           =				['''sentencepiece''']




  def __init__(   self  ,*__UpperCAmelCase  ,**__UpperCAmelCase				)   ->		str:
      requires_backends(self  ,["""sentencepiece"""]				)







class 	lowerCAmelCase_(    metaclass=SCREAMING_SNAKE_CASE_					):
  '''simple docstring'''




  __lowercase							:				Optional[Any]           =				['''sentencepiece''']




  def __init__(   self  ,*__UpperCAmelCase  ,**__UpperCAmelCase				)   ->		Optional[int]:
      requires_backends(self  ,["""sentencepiece"""]				)







class 	lowerCAmelCase_(    metaclass=SCREAMING_SNAKE_CASE_					):
  '''simple docstring'''




  __lowercase							:				List[Any]           =				['''sentencepiece''']




  def __init__(   self  ,*__UpperCAmelCase  ,**__UpperCAmelCase				)   ->		List[Any]:
      requires_backends(self  ,["""sentencepiece"""]				)


