






from ...configuration_utils import PretrainedConfig
from ...utils import logging


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

A_		:		int			= {
    'MCG-NJU/videomae-base': 'https://huggingface.co/MCG-NJU/videomae-base/resolve/main/config.json',
}




class 				_lowerCAmelCase(       _UpperCamelCase					):





       """simple docstring"""







       a				:		Tuple									='''videomae'''





       def __init__(					self  ,			_lowerCamelCase=2_2_4  ,			_lowerCamelCase=1_6  ,			_lowerCamelCase=3  ,			_lowerCamelCase=1_6  ,			_lowerCamelCase=2  ,			_lowerCamelCase=7_6_8  ,			_lowerCamelCase=1_2  ,			_lowerCamelCase=1_2  ,			_lowerCamelCase=3_0_7_2  ,			_lowerCamelCase="gelu"  ,			_lowerCamelCase=0.0  ,			_lowerCamelCase=0.0  ,			_lowerCamelCase=0.0_2  ,			_lowerCamelCase=1e-12  ,			_lowerCamelCase=True  ,			_lowerCamelCase=True  ,			_lowerCamelCase=6  ,			_lowerCamelCase=3_8_4  ,			_lowerCamelCase=4  ,			_lowerCamelCase=1_5_3_6  ,			_lowerCamelCase=True  ,			**_lowerCamelCase  ,			):
         super().__init__(**__a							)

         UpperCamelCase_:					Optional[Any]          =				image_size
         UpperCamelCase_:					Union[str, Any]          =				patch_size
         UpperCamelCase_:					Optional[int]          =				num_channels
         UpperCamelCase_:					List[str]          =				num_frames
         UpperCamelCase_:					Union[str, Any]          =				tubelet_size

         UpperCamelCase_:					Tuple          =				hidden_size
         UpperCamelCase_:					Dict          =				num_hidden_layers
         UpperCamelCase_:					str          =				num_attention_heads
         UpperCamelCase_:					List[Any]          =				intermediate_size
         UpperCamelCase_:					List[Any]          =				hidden_act
         UpperCamelCase_:					Optional[int]          =				hidden_dropout_prob
         UpperCamelCase_:					Optional[Any]          =				attention_probs_dropout_prob
         UpperCamelCase_:					Union[str, Any]          =				initializer_range
         UpperCamelCase_:					str          =				layer_norm_eps
         UpperCamelCase_:					List[Any]          =				qkv_bias
         UpperCamelCase_:					List[str]          =				use_mean_pooling

         UpperCamelCase_:					Dict          =				decoder_num_attention_heads
         UpperCamelCase_:					str          =				decoder_hidden_size
         UpperCamelCase_:					str          =				decoder_num_hidden_layers
         UpperCamelCase_:					Any          =				decoder_intermediate_size
         UpperCamelCase_:					Optional[Any]          =				norm_pix_loss


import unittest

from transformers import load_tool
from transformers.tools.agent_types import AGENT_TYPE_MAPPING

from .test_tools_common import ToolTesterMixin, output_types



class     lowercase						(       unittest.TestCase ,				_UpperCamelCase					):



 '''simple docstring'''


 def   UpperCamelCase__							(self ) ->					List[Any]:






  """simple docstring"""





  UpperCAmelCase__							=				load_tool('translation' )
  self.tool.setup()
  UpperCAmelCase__							=				load_tool('translation'       ,       remote=__a )




 def   UpperCamelCase__							(self ) ->					Optional[int]:






  """simple docstring"""





  UpperCAmelCase__							=				self.tool('Hey, what\'s up?'       ,       src_lang='English'       ,       tgt_lang='French' )
  self.assertEqual(__a       ,       '- Hé, comment ça va?' )




 def   UpperCamelCase__							(self ) ->					Any:






  """simple docstring"""





  UpperCAmelCase__							=				self.remote_tool('Hey, what\'s up?'       ,       src_lang='English'       ,       tgt_lang='French' )
  self.assertEqual(__a       ,       '- Hé, comment ça va?' )




 def   UpperCamelCase__							(self ) ->					Optional[int]:






  """simple docstring"""





  UpperCAmelCase__							=				self.tool(text='Hey, what\'s up?'       ,       src_lang='English'       ,       tgt_lang='French' )
  self.assertEqual(__a       ,       '- Hé, comment ça va?' )




 def   UpperCamelCase__							(self ) ->					Optional[Any]:






  """simple docstring"""





  UpperCAmelCase__							=				self.remote_tool(text='Hey, what\'s up?'       ,       src_lang='English'       ,       tgt_lang='French' )
  self.assertEqual(__a       ,       '- Hé, comment ça va?' )




 def   UpperCamelCase__							(self ) ->					Any:






  """simple docstring"""





  UpperCAmelCase__							=				['Hey, what\'s up?', 'English', 'Spanish']
  UpperCAmelCase__							=				self.tool(*__a )

  # There is a single output
  if len(self.tool.outputs ) == 1:
   UpperCAmelCase__							=				[outputs]

  self.assertListEqual(output_types(__a )       ,       self.tool.outputs )




 def   UpperCamelCase__							(self ) ->					Optional[int]:






  """simple docstring"""





  UpperCAmelCase__							=				['Hey, what\'s up?', 'English', 'Spanish']
  UpperCAmelCase__							=				self.tool(*__a )

  if not isinstance(__a       ,       __a ):
   UpperCAmelCase__							=				[outputs]

  self.assertEqual(len(__a )       ,       len(self.tool.outputs ) )

  for output, output_type in zip(__a       ,       self.tool.outputs ):
   UpperCAmelCase__							=				AGENT_TYPE_MAPPING[output_type]
   self.assertTrue(isinstance(__a       ,       __a ) )




 def   UpperCamelCase__							(self ) ->					Dict:






  """simple docstring"""





  UpperCAmelCase__							=				['Hey, what\'s up?', 'English', 'Spanish']

  UpperCAmelCase__							=				[]

  for _input, input_type in zip(__a       ,       self.tool.inputs ):
   if isinstance(__a       ,       __a ):
    _inputs.append([AGENT_TYPE_MAPPING[_input_type](_input ) for _input_type in input_type] )
   else:
    _inputs.append(AGENT_TYPE_MAPPING[input_type](_input ) )

        # Should not raise an error
  UpperCAmelCase__							=				self.tool(*__a )

  if not isinstance(__a       ,       __a ):
   UpperCAmelCase__							=				[outputs]

  self.assertEqual(len(__a )       ,       len(self.tool.outputs ) )



