




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


a_				:    List[Any]										=     logging.get_logger(__name__)

a_				:    Optional[int]										=     {
    '''bigcode/gpt_bigcode-santacoder''': '''https://huggingface.co/bigcode/gpt_bigcode-santacoder/resolve/main/config.json''',
}

class __lowercase(      UpperCamelCase__				):




					'''simple docstring'''


					__a						:						str     		= 'gpt_bigcode'
					__a						:						Any     		= ['past_key_values']
					__a						:						Any     		= {
					    'hidden_size': 'n_embd',
					    'max_position_embeddings': 'n_positions',
					    'num_attention_heads': 'n_head',
					    'num_hidden_layers': 'n_layer',
					}
					def __init__(    self						,	__a=50257						,	__a=1024						,	__a=768						,	__a=12						,	__a=12						,	__a=None						,	__a="gelu_pytorch_tanh"						,	__a=0.1						,	__a=0.1						,	__a=0.1						,	__a=1E-5						,	__a=0.02						,	__a=True						,	__a=True						,	__a=50256						,	__a=50256						,	__a=True						,	__a=True						,	__a=True						,	**__a						,	):
								__lowerCamelCase					:	Dict	       =				vocab_size
								__lowerCamelCase					:	Union[str, Any]	       =				n_positions
								__lowerCamelCase					:	Dict	       =				n_embd
								__lowerCamelCase					:	Optional[Any]	       =				n_layer
								__lowerCamelCase					:	Dict	       =				n_head
								__lowerCamelCase					:	Optional[Any]	       =				n_inner
								__lowerCamelCase					:	str	       =				activation_function
								__lowerCamelCase					:	List[Any]	       =				resid_pdrop
								__lowerCamelCase					:	str	       =				embd_pdrop
								__lowerCamelCase					:	Dict	       =				attn_pdrop
								__lowerCamelCase					:	Optional[Any]	       =				layer_norm_epsilon
								__lowerCamelCase					:	List[Any]	       =				initializer_range
								__lowerCamelCase					:	Any	       =				scale_attn_weights
								__lowerCamelCase					:	Optional[Any]	       =				use_cache
								__lowerCamelCase					:	Tuple	       =				attention_softmax_in_fpaa
								__lowerCamelCase					:	str	       =				scale_attention_softmax_in_fpaa
								__lowerCamelCase					:	Optional[Any]	       =				multi_query

								__lowerCamelCase					:	List[Any]	       =				bos_token_id
								__lowerCamelCase					:	Dict	       =				eos_token_id

								super().__init__(bos_token_id=__A						,	eos_token_id=__A						,	**__A     )









"""simple docstring"""
import warnings
from contextlib import contextmanager

from ...processing_utils import ProcessorMixin

class __lowercase(      lowercase__				):




					'''simple docstring'''


					__a						:						List[str]     		= 'Speech2TextFeatureExtractor'
					__a						:						Optional[int]     		= 'Speech2TextTokenizer'
					def __init__(    self						,	__a						,	__a     ):
								super().__init__(__a						,	__a     )
								__lowerCamelCase					:	Union[str, Any]	       =				self.feature_extractor
								__lowerCamelCase					:	List[str]	       =				False
					def __call__(    self						,	*__a						,	**__a     ):
								# For backward compatibility
								if self._in_target_context_manager:
											return self.current_processor(*__a						,	**__a     )

								if "raw_speech" in kwargs:
											warnings.warn('Using `raw_speech` as a keyword argument is deprecated. Use `audio` instead.'     )
											__lowerCamelCase					:	str	       =				kwargs.pop('raw_speech'     )
								else:
											__lowerCamelCase					:	Optional[Any]	       =				kwargs.pop('audio'						,	__a     )
								__lowerCamelCase					:	Optional[Any]	       =				kwargs.pop('sampling_rate'						,	__a     )
								__lowerCamelCase					:	Optional[int]	       =				kwargs.pop('text'						,	__a     )
								if len(__a     ) > 0:
											__lowerCamelCase					:	Optional[int]	       =				args[0]
											__lowerCamelCase					:	str	       =				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:
											__lowerCamelCase					:	Dict	       =				self.feature_extractor(__a						,	*__a						,	sampling_rate=__a						,	**__a     )
								if text is not None:
											__lowerCamelCase					:	Optional[int]	       =				self.tokenizer(__a						,	**__a     )

								if text is None:
											return inputs
								elif audio is None:
											return encodings
								else:
											__lowerCamelCase					:	Any	       =				encodings['input_ids']
											return inputs
					def     snake_case_				(    self						,	*__a						,	**__a     ):
								return self.tokenizer.batch_decode(*__a						,	**__a     )
					def     snake_case_				(    self						,	*__a						,	**__a     ):
								return self.tokenizer.decode(*__a						,	**__a     )





					@contextmanager
					def     snake_case_				(    self     ):
								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.'     )
								__lowerCamelCase					:	int	       =				True
								__lowerCamelCase					:	Union[str, Any]	       =				self.tokenizer
								yield
								__lowerCamelCase					:	Tuple	       =				self.feature_extractor
								__lowerCamelCase					:	List[str]	       =				False



