


'''simple docstring'''
from ...configuration_utils import PretrainedConfig
from ...utils import logging


__SCREAMING_SNAKE_CASE					:				Optional[Any]									=		logging.get_logger(__name__)

__SCREAMING_SNAKE_CASE					:				Tuple									=		{
    '''facebook/s2t-wav2vec2-large-en-de''': (
        '''https://huggingface.co/facebook/s2t-wav2vec2-large-en-de/resolve/main/config.json'''
    ),
    # See all Speech2Text models at https://huggingface.co/models?filter=speech2text2
}






class 					__lowerCAmelCase   (   lowercase						):

						"""simple docstring"""






						_UpperCAmelCase		:       Tuple   						="speech_to_text_2"
						_UpperCAmelCase		:       int   						=["past_key_values"]
						_UpperCAmelCase		:       Dict   						={"num_attention_heads": "decoder_attention_heads", "hidden_size": "d_model"}






						def __init__(  self							:      Any ,  lowerCAmelCase							:      Any=1_00_00 ,  lowerCAmelCase							:      Union[str, Any]=6 ,  lowerCAmelCase							:      Tuple=20_48 ,  lowerCAmelCase							:      int=4 ,  lowerCAmelCase							:      List[Any]=0.0 ,  lowerCAmelCase							:      str=True ,  lowerCAmelCase							:      Tuple="relu" ,  lowerCAmelCase							:      Tuple=2_56 ,  lowerCAmelCase							:      str=0.1 ,  lowerCAmelCase							:      str=0.0 ,  lowerCAmelCase							:      str=0.0 ,  lowerCAmelCase							:      int=0.0_2 ,  lowerCAmelCase							:      Optional[int]=2 ,  lowerCAmelCase							:      Optional[int]=True ,  lowerCAmelCase							:      List[Any]=1 ,  lowerCAmelCase							:      List[Any]=0 ,  lowerCAmelCase							:      List[str]=2 ,  lowerCAmelCase							:      Tuple=10_24 ,  **lowerCAmelCase							:      Any ,  ):
													A_			    =		vocab_size
													A_			    =		d_model
													A_			    =		decoder_ffn_dim
													A_			    =		decoder_layers
													A_			    =		decoder_attention_heads
													A_			    =		dropout
													A_			    =		attention_dropout
													A_			    =		activation_dropout
													A_			    =		activation_function
													A_			    =		init_std
													A_			    =		decoder_layerdrop
													A_			    =		use_cache
													A_			    =		decoder_layers
													A_			    =		scale_embedding  # scale factor will be sqrt(d_model) if True
													A_			    =		max_target_positions

													super().__init__(
													    pad_token_id=lowerCAmelCase ,  bos_token_id=lowerCAmelCase ,  eos_token_id=lowerCAmelCase ,  decoder_start_token_id=lowerCAmelCase ,  **lowerCAmelCase ,  )









'''simple docstring'''
import unittest

from transformers import load_tool

from .test_tools_common import ToolTesterMixin






class 					__lowerCAmelCase   (   unittest.TestCase				,			lowercase						):

						"""simple docstring"""






						def 				_UpperCAmelCase       (  self							:      List[str]	):
													A_			    =		load_tool("text-classification"	)
													self.tool.setup()
													A_			    =		load_tool("text-classification" ,  remote=lowerCAmelCase	)






						def 				_UpperCAmelCase       (  self							:      Union[str, Any]	):
													A_			    =		self.tool("That's quite cool" ,  ["positive", "negative"]	)
													self.assertEqual(lowerCAmelCase ,  "positive"	)






						def 				_UpperCAmelCase       (  self							:      str	):
													A_			    =		self.remote_tool("That's quite cool" ,  ["positive", "negative"]	)
													self.assertEqual(lowerCAmelCase ,  "positive"	)






						def 				_UpperCAmelCase       (  self							:      str	):
													A_			    =		self.tool(text="That's quite cool" ,  labels=["positive", "negative"]	)
													self.assertEqual(lowerCAmelCase ,  "positive"	)






						def 				_UpperCAmelCase       (  self							:      List[Any]	):
													A_			    =		self.remote_tool(text="That's quite cool" ,  labels=["positive", "negative"]	)
													self.assertEqual(lowerCAmelCase ,  "positive"	)





