'''simple docstring'''




from typing import Callable, Optional, Union

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


__lowercase        =    logging.get_logger(__name__)

__lowercase        =    {
    '''microsoft/xprophetnet-large-wiki100-cased''': (
        '''https://huggingface.co/microsoft/xprophetnet-large-wiki100-cased/resolve/main/config.json'''
    ),
}






class 							a__(   lowerCAmelCase__      ):


			'''simple docstring'''






			UpperCAmelCase_     :	int						=			'''xlm-prophetnet'''
			UpperCAmelCase_     :	int						=			['''past_key_values''']
			UpperCAmelCase_     :	List[Any]						=			{
			    '''num_attention_heads''': '''num_encoder_attention_heads''',
			}



			def __init__(  self			,       __lowerCAmelCase = 0.1			,       __lowerCAmelCase = "gelu"			,       __lowerCAmelCase = 30522			,       __lowerCAmelCase = 1024			,       __lowerCAmelCase = 4096			,       __lowerCAmelCase = 12			,       __lowerCAmelCase = 16			,       __lowerCAmelCase = 4096			,       __lowerCAmelCase = 12			,       __lowerCAmelCase = 16			,       __lowerCAmelCase = 0.1			,       __lowerCAmelCase = 0.1			,       __lowerCAmelCase = 512			,       __lowerCAmelCase = 0.02			,       __lowerCAmelCase = True			,       __lowerCAmelCase = True			,       __lowerCAmelCase = 0			,       __lowerCAmelCase = 2			,       __lowerCAmelCase = 32			,       __lowerCAmelCase = 128			,       __lowerCAmelCase = False			,       __lowerCAmelCase = 0.0			,       __lowerCAmelCase = True			,       __lowerCAmelCase = 0			,       __lowerCAmelCase = 1			,       __lowerCAmelCase = 2			,       **__lowerCAmelCase			,       ):




					"""simple docstring"""


					lowerCAmelCase     =    vocab_size
					lowerCAmelCase     =    hidden_size
					lowerCAmelCase     =    encoder_ffn_dim
					lowerCAmelCase     =    num_encoder_layers
					lowerCAmelCase     =    num_encoder_attention_heads
					lowerCAmelCase     =    decoder_ffn_dim
					lowerCAmelCase     =    num_decoder_layers
					lowerCAmelCase     =    num_decoder_attention_heads
					lowerCAmelCase     =    max_position_embeddings
					lowerCAmelCase     =    init_std  # Normal(0, this parameter)
					lowerCAmelCase     =    activation_function

					# parameters for xlmprophetnet
					lowerCAmelCase     =    ngram
					lowerCAmelCase     =    num_buckets
					lowerCAmelCase     =    relative_max_distance
					lowerCAmelCase     =    disable_ngram_loss
					lowerCAmelCase     =    eps

					# 3 Types of Dropout
					lowerCAmelCase     =    attention_dropout
					lowerCAmelCase     =    activation_dropout
					lowerCAmelCase     =    dropout

					lowerCAmelCase     =    use_cache

					super().__init__(
					    pad_token_id=__lowerCAmelCase			,       bos_token_id=__lowerCAmelCase			,       eos_token_id=__lowerCAmelCase			,       is_encoder_decoder=__lowerCAmelCase			,       add_cross_attention=__lowerCAmelCase			,       decoder_start_token_id=__lowerCAmelCase			,       **__lowerCAmelCase			,       )



			@property
			def 				a_			(  self):




					"""simple docstring"""


					return self.num_encoder_layers + self.num_decoder_layers







			@num_hidden_layers.setter
			def 				a_			(  self			,       __lowerCAmelCase):




					"""simple docstring"""


					raise NotImplementedError(
					    """This model does not support the setting of `num_hidden_layers`. Please set `num_encoder_layers` and"""
					    """ `num_decoder_layers`.""")





'''simple docstring'''




import copy
from dataclasses import dataclass, field
from typing import ClassVar, Dict

from ..features import Audio, Features, Value
from .base import TaskTemplate






@dataclass(frozen=lowerCAmelCase__      )
class 							a__(   lowerCAmelCase__      ):


			'''simple docstring'''






			UpperCAmelCase_     :	str						=			field(default='''automatic-speech-recognition'''					,		metadata={'''include_in_asdict_even_if_is_default''': True}      )
			UpperCAmelCase_     :	ClassVar[Features]						=			Features({'''audio''': Audio()}      )
			UpperCAmelCase_     :	ClassVar[Features]						=			Features({'''transcription''': Value('''string'''      )}      )
			UpperCAmelCase_     :	str						=			"audio"
			UpperCAmelCase_     :	str						=			"transcription"



			def 				a_			(  self			,       __lowerCAmelCase):




					"""simple docstring"""


					if self.audio_column not in features:
							raise ValueError(f"Column {self.audio_column} is not present in features.")
					if not isinstance(features[self.audio_column]			,       __lowerCAmelCase):
							raise ValueError(f"Column {self.audio_column} is not an Audio type.")
					lowerCAmelCase     =    copy.deepcopy(self)
					lowerCAmelCase     =    self.input_schema.copy()
					lowerCAmelCase     =    features[self.audio_column]
					lowerCAmelCase     =    input_schema
					return task_template







			@property
			def 				a_			(  self):




					"""simple docstring"""


					return {self.audio_column: "audio", self.transcription_column: "transcription"}




