




from ...processing_utils import ProcessorMixin


class        UpperCamelCase_					(				UpperCAmelCase__  ):

    '''simple docstring'''






    UpperCAmelCase__													=   '''WhisperFeatureExtractor'''
    UpperCAmelCase__													=   '''WhisperTokenizer'''


    def __init__(    self   :			Tuple      ,				UpperCAmelCase__   :			Dict      ,				UpperCAmelCase__   :			Optional[int])		->str:





           '''simple docstring'''

           super().__init__(UpperCAmelCase__      ,				UpperCAmelCase__)
           A__   				=					self.feature_extractor
           A__   				=					False


    def  SCREAMING_SNAKE_CASE							(    self   :			Union[str, Any]      ,				UpperCAmelCase__   :			int=None      ,				UpperCAmelCase__   :			List[Any]=None      ,				UpperCAmelCase__   :			Tuple=True)		->Dict:





           '''simple docstring'''

           return self.tokenizer.get_decoder_prompt_ids(task=UpperCAmelCase__      ,				language=UpperCAmelCase__      ,				no_timestamps=UpperCAmelCase__)


    def __call__(    self   :			Optional[Any]      ,				*UpperCAmelCase__   :			Dict      ,				**UpperCAmelCase__   :			str)		->int:





           '''simple docstring'''

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

           A__   				=					kwargs.pop('''audio'''      ,				UpperCAmelCase__)
           A__   				=					kwargs.pop('''sampling_rate'''      ,				UpperCAmelCase__)
           A__   				=					kwargs.pop('''text'''      ,				UpperCAmelCase__)
           if len(UpperCAmelCase__) > 0:
                  A__   				=					args[0]
                  A__   				=					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:
                  A__   				=					self.feature_extractor(UpperCAmelCase__      ,				*UpperCAmelCase__      ,				sampling_rate=UpperCAmelCase__      ,				**UpperCAmelCase__)
           if text is not None:
                  A__   				=					self.tokenizer(UpperCAmelCase__      ,				**UpperCAmelCase__)

           if text is None:
                  return inputs

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


    def  SCREAMING_SNAKE_CASE							(    self   :			List[Any]      ,				*UpperCAmelCase__   :			Any      ,				**UpperCAmelCase__   :			Optional[Any])		->List[str]:





           '''simple docstring'''

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


    def  SCREAMING_SNAKE_CASE							(    self   :			Optional[Any]      ,				*UpperCAmelCase__   :			str      ,				**UpperCAmelCase__   :			List[str])		->List[str]:





           '''simple docstring'''

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





    def  SCREAMING_SNAKE_CASE							(    self   :			Tuple      ,				UpperCAmelCase__   :			str      ,				UpperCAmelCase__   :			int="np")		->Optional[int]:





           '''simple docstring'''

           return self.tokenizer.get_prompt_ids(UpperCAmelCase__      ,				return_tensors=UpperCAmelCase__)








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


_lowerCamelCase			:	Tuple							 =     logging.get_logger(__name__)

_lowerCamelCase			:	Tuple							 =     {
    """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        UpperCamelCase_					(				UpperCAmelCase__  ):

    '''simple docstring'''






    UpperCAmelCase__													=   '''falcon'''
    UpperCAmelCase__													=   ['''past_key_values''']


    def __init__(    self   :			Optional[Any]      ,				UpperCAmelCase__   :			str=65_024      ,				UpperCAmelCase__   :			List[Any]=4_544      ,				UpperCAmelCase__   :			Optional[Any]=32      ,				UpperCAmelCase__   :			Dict=71      ,				UpperCAmelCase__   :			Any=1e-5      ,				UpperCAmelCase__   :			Optional[int]=0.02      ,				UpperCAmelCase__   :			Optional[int]=True      ,				UpperCAmelCase__   :			Union[str, Any]=0.0      ,				UpperCAmelCase__   :			List[str]=0.0      ,				UpperCAmelCase__   :			str=None      ,				UpperCAmelCase__   :			Dict=False      ,				UpperCAmelCase__   :			List[str]=False      ,				UpperCAmelCase__   :			Optional[Any]=True      ,				UpperCAmelCase__   :			Optional[Any]=True      ,				UpperCAmelCase__   :			Optional[Any]=False      ,				UpperCAmelCase__   :			Dict=11      ,				UpperCAmelCase__   :			str=11      ,				**UpperCAmelCase__   :			Dict      ,				)		->Any:





           '''simple docstring'''

           A__   				=					vocab_size
           # Backward compatibility with n_embed kwarg
           A__   				=					kwargs.pop('''n_embed'''      ,				UpperCAmelCase__)
           A__   				=					hidden_size if n_embed is None else n_embed
           A__   				=					num_hidden_layers
           A__   				=					num_attention_heads
           A__   				=					layer_norm_epsilon
           A__   				=					initializer_range
           A__   				=					use_cache
           A__   				=					hidden_dropout
           A__   				=					attention_dropout

           A__   				=					bos_token_id
           A__   				=					eos_token_id
           A__   				=					num_attention_heads if num_kv_heads is None else num_kv_heads
           A__   				=					alibi
           A__   				=					new_decoder_architecture
           A__   				=					multi_query  # Ignored when new_decoder_architecture is True
           A__   				=					parallel_attn
           A__   				=					bias

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


    @property
    def  SCREAMING_SNAKE_CASE							(    self   :			str)		->int:





           '''simple docstring'''

           return self.hidden_size // self.num_attention_heads





    @property
    def  SCREAMING_SNAKE_CASE							(    self   :			str)		->Dict:





           '''simple docstring'''

           return not self.alibi


