




from collections import OrderedDict
from typing import Mapping

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig


UpperCAmelCase_		:				List[Any]									=     {
    """albert-base-v1""": """https://huggingface.co/albert-base-v1/resolve/main/config.json""",
    """albert-large-v1""": """https://huggingface.co/albert-large-v1/resolve/main/config.json""",
    """albert-xlarge-v1""": """https://huggingface.co/albert-xlarge-v1/resolve/main/config.json""",
    """albert-xxlarge-v1""": """https://huggingface.co/albert-xxlarge-v1/resolve/main/config.json""",
    """albert-base-v2""": """https://huggingface.co/albert-base-v2/resolve/main/config.json""",
    """albert-large-v2""": """https://huggingface.co/albert-large-v2/resolve/main/config.json""",
    """albert-xlarge-v2""": """https://huggingface.co/albert-xlarge-v2/resolve/main/config.json""",
    """albert-xxlarge-v2""": """https://huggingface.co/albert-xxlarge-v2/resolve/main/config.json""",
}




class 		__A      (			snake_case_			):
						UpperCamelCase     						=					"""albert"""

						def __init__(		self   :Optional[Any]    , __snake_case   :Optional[Any]=3_00_00    , __snake_case   :Dict=1_28    , __snake_case   :Union[str, Any]=40_96    , __snake_case   :List[Any]=12    , __snake_case   :int=1    , __snake_case   :str=64    , __snake_case   :Any=1_63_84    , __snake_case   :str=1    , __snake_case   :List[str]="gelu_new"    , __snake_case   :Optional[int]=0    , __snake_case   :Dict=0    , __snake_case   :Optional[int]=5_12    , __snake_case   :Any=2    , __snake_case   :Optional[Any]=0.02    , __snake_case   :Optional[Any]=1E-12    , __snake_case   :Optional[int]=0.1    , __snake_case   :Tuple="absolute"    , __snake_case   :Union[str, Any]=0    , __snake_case   :Tuple=2    , __snake_case   :int=3    , **__snake_case   :List[str]    , ):
										'''simple docstring'''

										super().__init__(pad_token_id=__snake_case    , bos_token_id=__snake_case    , eos_token_id=__snake_case    , **__snake_case )

										__magic_name__	:	Optional[int]								=vocab_size
										__magic_name__	:	Dict								=embedding_size
										__magic_name__	:	Any								=hidden_size
										__magic_name__	:	str								=num_hidden_layers
										__magic_name__	:	Dict								=num_hidden_groups
										__magic_name__	:	Dict								=num_attention_heads
										__magic_name__	:	Optional[Any]								=inner_group_num
										__magic_name__	:	Union[str, Any]								=hidden_act
										__magic_name__	:	str								=intermediate_size
										__magic_name__	:	Optional[Any]								=hidden_dropout_prob
										__magic_name__	:	List[str]								=attention_probs_dropout_prob
										__magic_name__	:	Any								=max_position_embeddings
										__magic_name__	:	int								=type_vocab_size
										__magic_name__	:	Optional[int]								=initializer_range
										__magic_name__	:	str								=layer_norm_eps
										__magic_name__	:	Tuple								=classifier_dropout_prob
										__magic_name__	:	List[str]								=position_embedding_type




class 		__A      (			snake_case_			):

						@property
						def     A__						(		self   :List[Any] ):
										'''simple docstring'''

										if self.task == "multiple-choice":
														__magic_name__	:	List[Any]								={0: """batch""", 1: """choice""", 2: """sequence"""}
										else:
														__magic_name__	:	Tuple								={0: """batch""", 1: """sequence"""}
										return OrderedDict(
										    [
										        ("""input_ids""", dynamic_axis),
										        ("""attention_mask""", dynamic_axis),
										        ("""token_type_ids""", dynamic_axis),
										    ] )










import warnings
from contextlib import contextmanager

from ...processing_utils import ProcessorMixin




class 		__A      (			UpperCamelCase__			):
						UpperCamelCase     						=					"""Speech2TextFeatureExtractor"""
						UpperCamelCase     						=					"""Speech2TextTokenizer"""

						def __init__(		self   :Any    , __snake_case   :int    , __snake_case   :Any ):
										'''simple docstring'''

										super().__init__(__snake_case    , __snake_case )
										__magic_name__	:	Optional[int]								=self.feature_extractor
										__magic_name__	:	Any								=False

						def __call__(		self   :Tuple    , *__snake_case   :List[str]    , **__snake_case   :List[str] ):
										'''simple docstring'''

										if self._in_target_context_manager:
														return self.current_processor(*__snake_case    , **__snake_case )

										if "raw_speech" in kwargs:
														warnings.warn("""Using `raw_speech` as a keyword argument is deprecated. Use `audio` instead.""" )
														__magic_name__	:	Tuple								=kwargs.pop("""raw_speech""" )
										else:
														__magic_name__	:	List[Any]								=kwargs.pop("""audio"""    , __snake_case )
										__magic_name__	:	Union[str, Any]								=kwargs.pop("""sampling_rate"""    , __snake_case )
										__magic_name__	:	Dict								=kwargs.pop("""text"""    , __snake_case )
										if len(__snake_case ) > 0:
														__magic_name__	:	Union[str, Any]								=args[0]
														__magic_name__	:	int								=args[1:]

										if audio is None and text is None:
														raise ValueError("""You need to specify either an `audio` or `text` input to process.""" )

										if audio is not None:
														__magic_name__	:	List[str]								=self.feature_extractor(__snake_case    , *__snake_case    , sampling_rate=__snake_case    , **__snake_case )
										if text is not None:
														__magic_name__	:	Any								=self.tokenizer(__snake_case    , **__snake_case )

										if text is None:
														return inputs
										elif audio is None:
														return encodings
										else:
														__magic_name__	:	List[str]								=encodings["""input_ids"""]
														return inputs

						def     A__						(		self   :List[Any]    , *__snake_case   :str    , **__snake_case   :List[str] ):
										'''simple docstring'''

										return self.tokenizer.batch_decode(*__snake_case    , **__snake_case )

						def     A__						(		self   :int    , *__snake_case   :int    , **__snake_case   :Optional[int] ):
										'''simple docstring'''

										return self.tokenizer.decode(*__snake_case    , **__snake_case )


						@contextmanager
						def     A__						(		self   :int ):
										'''simple docstring'''

										warnings.warn(
										    """`as_target_processor` is deprecated and will be removed in v5 of Transformers. You can process your """
										    """labels by using the argument `text` of the regular `__call__` method (either in the same call as """
										    """your audio inputs, or in a separate call.""" )
										__magic_name__	:	int								=True
										__magic_name__	:	List[Any]								=self.tokenizer
										yield
										__magic_name__	:	List[Any]								=self.feature_extractor
										__magic_name__	:	str								=False




