






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


SCREAMING_SNAKE_CASE__      :			Dict							=		logging.get_logger(__name__)

SCREAMING_SNAKE_CASE__      :			str							=		{
    """tiiuae/falcon-40b""": """https://huggingface.co/tiiuae/falcon-40b/resolve/main/config.json""",
    """tiiuae/falcon-7b""": """https://huggingface.co/tiiuae/falcon-7b/resolve/main/config.json""",
}
class 						lowerCamelCase_				(      lowerCamelCase ):
				a__					       =  '''falcon'''
				a__					       =  ['''past_key_values''']







				def __init__(						self       ,					__lowerCAmelCase=6_5_0_2_4       ,					__lowerCAmelCase=4_5_4_4       ,					__lowerCAmelCase=3_2       ,					__lowerCAmelCase=7_1       ,					__lowerCAmelCase=1E-5       ,					__lowerCAmelCase=0.02       ,					__lowerCAmelCase=True       ,					__lowerCAmelCase=0.0       ,					__lowerCAmelCase=0.0       ,					__lowerCAmelCase=None       ,					__lowerCAmelCase=False       ,					__lowerCAmelCase=False       ,					__lowerCAmelCase=True       ,					__lowerCAmelCase=True       ,					__lowerCAmelCase=False       ,					__lowerCAmelCase=1_1       ,					__lowerCAmelCase=1_1       ,					**__lowerCAmelCase       ,					):
								"""simple docstring"""
								__magic_name__		:Optional[Any]        =      vocab_size
								# Backward compatibility with n_embed kwarg
								__magic_name__		:str        =      kwargs.pop('''n_embed'''       ,					__lowerCAmelCase     )
								__magic_name__		:Union[str, Any]        =      hidden_size if n_embed is None else n_embed
								__magic_name__		:Any        =      num_hidden_layers
								__magic_name__		:Tuple        =      num_attention_heads
								__magic_name__		:Optional[Any]        =      layer_norm_epsilon
								__magic_name__		:Tuple        =      initializer_range
								__magic_name__		:Tuple        =      use_cache
								__magic_name__		:Optional[Any]        =      hidden_dropout
								__magic_name__		:Optional[int]        =      attention_dropout

								__magic_name__		:int        =      bos_token_id
								__magic_name__		:Union[str, Any]        =      eos_token_id
								__magic_name__		:Tuple        =      num_attention_heads if num_kv_heads is None else num_kv_heads
								__magic_name__		:Optional[Any]        =      alibi
								__magic_name__		:List[Any]        =      new_decoder_architecture
								__magic_name__		:Optional[Any]        =      multi_query  # Ignored when new_decoder_architecture is True
								__magic_name__		:Dict        =      parallel_attn
								__magic_name__		:List[Any]        =      bias

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







				@property
				def 			A	(						self     ):
								"""simple docstring"""
								return self.hidden_size // self.num_attention_heads







				@property
				def 			A	(						self     ):
								"""simple docstring"""
								return not self.alibi














from ...processing_utils import ProcessorMixin
class 						lowerCamelCase_				(      lowerCamelCase ):
				a__					       =  '''WhisperFeatureExtractor'''
				a__					       =  '''WhisperTokenizer'''







				def __init__(						self       ,					__lowerCAmelCase       ,					__lowerCAmelCase     ):
								"""simple docstring"""
								super().__init__(__lowerCAmelCase       ,					__lowerCAmelCase     )
								__magic_name__		:int        =      self.feature_extractor
								__magic_name__		:int        =      False







				def 			A	(						self       ,					__lowerCAmelCase=None       ,					__lowerCAmelCase=None       ,					__lowerCAmelCase=True     ):
								"""simple docstring"""
								return self.tokenizer.get_decoder_prompt_ids(task=__lowerCAmelCase       ,					language=__lowerCAmelCase       ,					no_timestamps=__lowerCAmelCase     )







				def __call__(						self       ,					*__lowerCAmelCase       ,					**__lowerCAmelCase     ):
								"""simple docstring"""
								# For backward compatibility
								if self._in_target_context_manager:
												return self.current_processor(*__lowerCAmelCase       ,					**__lowerCAmelCase     )

								__magic_name__		:List[Any]        =      kwargs.pop('''audio'''       ,					__lowerCAmelCase     )
								__magic_name__		:Any        =      kwargs.pop('''sampling_rate'''       ,					__lowerCAmelCase     )
								__magic_name__		:str        =      kwargs.pop('''text'''       ,					__lowerCAmelCase     )
								if len(__lowerCAmelCase     ) > 0:
												__magic_name__		:Any        =      args[0]
												__magic_name__		:Union[str, Any]        =      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__		:Optional[int]        =      self.feature_extractor(__lowerCAmelCase       ,					*__lowerCAmelCase       ,					sampling_rate=__lowerCAmelCase       ,					**__lowerCAmelCase     )
								if text is not None:
												__magic_name__		:Optional[int]        =      self.tokenizer(__lowerCAmelCase       ,					**__lowerCAmelCase     )

								if text is None:
												return inputs

								elif audio is None:
												return encodings
								else:
												__magic_name__		:str        =      encodings['''input_ids''']
												return inputs







				def 			A	(						self       ,					*__lowerCAmelCase       ,					**__lowerCAmelCase     ):
								"""simple docstring"""
								return self.tokenizer.batch_decode(*__lowerCAmelCase       ,					**__lowerCAmelCase     )







				def 			A	(						self       ,					*__lowerCAmelCase       ,					**__lowerCAmelCase     ):
								"""simple docstring"""
								return self.tokenizer.decode(*__lowerCAmelCase       ,					**__lowerCAmelCase     )







				def 			A	(						self       ,					__lowerCAmelCase       ,					__lowerCAmelCase="np"     ):
								"""simple docstring"""
								return self.tokenizer.get_prompt_ids(__lowerCAmelCase       ,					return_tensors=__lowerCAmelCase     )






