



"""simple docstring"""

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


A_						:    Dict				=      logging.get_logger(__name__)

A_						:    Optional[Any]				=      {
    'facebook/s2t-small-librispeech-asr': (
        'https://huggingface.co/facebook/s2t-small-librispeech-asr/resolve/main/config.json'
    ),
    # See all Speech2Text models at https://huggingface.co/models?filter=speech_to_text
}
class     lowerCAmelCase__						(	_lowerCamelCase ):


	'''simple docstring'''







	_SCREAMING_SNAKE_CASE	:		Any  						= '''speech_to_text'''
	_SCREAMING_SNAKE_CASE	:		Dict  						= ['''past_key_values''']
	_SCREAMING_SNAKE_CASE	:		List[Any]  						= {'''num_attention_heads''': '''encoder_attention_heads''', '''hidden_size''': '''d_model'''}





	def __init__(      self				:       Dict     ,       _SCREAMING_SNAKE_CASE				:       Union[str, Any]=10_000     ,       _SCREAMING_SNAKE_CASE				:       Optional[Any]=12     ,       _SCREAMING_SNAKE_CASE				:       int=2_048     ,       _SCREAMING_SNAKE_CASE				:       str=4     ,       _SCREAMING_SNAKE_CASE				:       str=6     ,       _SCREAMING_SNAKE_CASE				:       str=2_048     ,       _SCREAMING_SNAKE_CASE				:       Tuple=4     ,       _SCREAMING_SNAKE_CASE				:       Dict=0.0     ,       _SCREAMING_SNAKE_CASE				:       Dict=0.0     ,       _SCREAMING_SNAKE_CASE				:       Tuple=True     ,       _SCREAMING_SNAKE_CASE				:       Union[str, Any]=True     ,       _SCREAMING_SNAKE_CASE				:       Dict="relu"     ,       _SCREAMING_SNAKE_CASE				:       List[str]=256     ,       _SCREAMING_SNAKE_CASE				:       List[Any]=0.1     ,       _SCREAMING_SNAKE_CASE				:       Optional[int]=0.0     ,       _SCREAMING_SNAKE_CASE				:       List[str]=0.0     ,       _SCREAMING_SNAKE_CASE				:       Tuple=0.0_2     ,       _SCREAMING_SNAKE_CASE				:       Tuple=2     ,       _SCREAMING_SNAKE_CASE				:       int=True     ,       _SCREAMING_SNAKE_CASE				:       List[str]=1     ,       _SCREAMING_SNAKE_CASE				:       List[Any]=0     ,       _SCREAMING_SNAKE_CASE				:       Union[str, Any]=2     ,       _SCREAMING_SNAKE_CASE				:       List[Any]=6_000     ,       _SCREAMING_SNAKE_CASE				:       Optional[int]=1_024     ,       _SCREAMING_SNAKE_CASE				:       int=2     ,       _SCREAMING_SNAKE_CASE				:       List[Any]=(5, 5)     ,       _SCREAMING_SNAKE_CASE				:       List[str]=1_024     ,       _SCREAMING_SNAKE_CASE				:       Optional[Any]=80     ,       _SCREAMING_SNAKE_CASE				:       Optional[int]=1     ,       **_SCREAMING_SNAKE_CASE				:       Union[str, Any]     ,       )						->	Optional[int]:





					"""simple docstring"""


					SCREAMING_SNAKE_CASE						:							Union[str, Any]							=     vocab_size
					SCREAMING_SNAKE_CASE						:							Dict							=     d_model
					SCREAMING_SNAKE_CASE						:							Dict							=     encoder_ffn_dim
					SCREAMING_SNAKE_CASE						:							Union[str, Any]							=     encoder_layers
					SCREAMING_SNAKE_CASE						:							Optional[int]							=     encoder_attention_heads
					SCREAMING_SNAKE_CASE						:							List[Any]							=     decoder_ffn_dim
					SCREAMING_SNAKE_CASE						:							Any							=     decoder_layers
					SCREAMING_SNAKE_CASE						:							str							=     decoder_attention_heads
					SCREAMING_SNAKE_CASE						:							str							=     dropout
					SCREAMING_SNAKE_CASE						:							Dict							=     attention_dropout
					SCREAMING_SNAKE_CASE						:							List[Any]							=     activation_dropout
					SCREAMING_SNAKE_CASE						:							Dict							=     activation_function
					SCREAMING_SNAKE_CASE						:							Tuple							=     init_std
					SCREAMING_SNAKE_CASE						:							int							=     encoder_layerdrop
					SCREAMING_SNAKE_CASE						:							Any							=     decoder_layerdrop
					SCREAMING_SNAKE_CASE						:							Dict							=     use_cache
					SCREAMING_SNAKE_CASE						:							Tuple							=     encoder_layers
					SCREAMING_SNAKE_CASE						:							Optional[int]							=     scale_embedding  # scale factor will be sqrt(d_model) if True
					SCREAMING_SNAKE_CASE						:							Optional[Any]							=     max_source_positions
					SCREAMING_SNAKE_CASE						:							List[Any]							=     max_target_positions
					SCREAMING_SNAKE_CASE						:							Dict							=     num_conv_layers
					SCREAMING_SNAKE_CASE						:							Any							=     list(_SCREAMING_SNAKE_CASE    )
					SCREAMING_SNAKE_CASE						:							int							=     conv_channels
					SCREAMING_SNAKE_CASE						:							Any							=     input_feat_per_channel
					SCREAMING_SNAKE_CASE						:							Union[str, Any]							=     input_channels

					if len(self.conv_kernel_sizes    ) != self.num_conv_layers:
									raise ValueError(
									    'Configuration for convolutional module is incorrect. '
									    'It is required that `len(config.conv_kernel_sizes)` == `config.num_conv_layers` '
									    f"""but is `len(config.conv_kernel_sizes) = {len(self.conv_kernel_sizes    )}`, """
									    f"""`config.num_conv_layers = {self.num_conv_layers}`."""    )

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










"""simple docstring"""

A_						:    Optional[Any]				=      '0.18.2'

from .configuration_utils import ConfigMixin
from .utils import (
    OptionalDependencyNotAvailable,
    is_flax_available,
    is_inflect_available,
    is_invisible_watermark_available,
    is_k_diffusion_available,
    is_k_diffusion_version,
    is_librosa_available,
    is_note_seq_available,
    is_onnx_available,
    is_scipy_available,
    is_torch_available,
    is_torchsde_available,
    is_transformers_available,
    is_transformers_version,
    is_unidecode_available,
    logging,
)


try:
							if not is_onnx_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							from .utils.dummy_onnx_objects import *  # noqa F403
else:
							from .pipelines import OnnxRuntimeModel

try:
							if not is_torch_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							from .utils.dummy_pt_objects import *  # noqa F403
else:
							from .models import (
							    AutoencoderKL,
							    ControlNetModel,
							    ModelMixin,
							    PriorTransformer,
							    TaFilmDecoder,
							    TransformeraDModel,
							    UNetaDModel,
							    UNetaDConditionModel,
							    UNetaDModel,
							    UNetaDConditionModel,
							    VQModel,
							)
							from .optimization import (
							    get_constant_schedule,
							    get_constant_schedule_with_warmup,
							    get_cosine_schedule_with_warmup,
							    get_cosine_with_hard_restarts_schedule_with_warmup,
							    get_linear_schedule_with_warmup,
							    get_polynomial_decay_schedule_with_warmup,
							    get_scheduler,
							)
							from .pipelines import (
							    AudioPipelineOutput,
							    ConsistencyModelPipeline,
							    DanceDiffusionPipeline,
							    DDIMPipeline,
							    DDPMPipeline,
							    DiffusionPipeline,
							    DiTPipeline,
							    ImagePipelineOutput,
							    KarrasVePipeline,
							    LDMPipeline,
							    LDMSuperResolutionPipeline,
							    PNDMPipeline,
							    RePaintPipeline,
							    ScoreSdeVePipeline,
							)
							from .schedulers import (
							    CMStochasticIterativeScheduler,
							    DDIMInverseScheduler,
							    DDIMParallelScheduler,
							    DDIMScheduler,
							    DDPMParallelScheduler,
							    DDPMScheduler,
							    DEISMultistepScheduler,
							    DPMSolverMultistepInverseScheduler,
							    DPMSolverMultistepScheduler,
							    DPMSolverSinglestepScheduler,
							    EulerAncestralDiscreteScheduler,
							    EulerDiscreteScheduler,
							    HeunDiscreteScheduler,
							    IPNDMScheduler,
							    KarrasVeScheduler,
							    KDPMaAncestralDiscreteScheduler,
							    KDPMaDiscreteScheduler,
							    PNDMScheduler,
							    RePaintScheduler,
							    SchedulerMixin,
							    ScoreSdeVeScheduler,
							    UnCLIPScheduler,
							    UniPCMultistepScheduler,
							    VQDiffusionScheduler,
							)
							from .training_utils import EMAModel

try:
							if not (is_torch_available() and is_scipy_available()):
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							from .utils.dummy_torch_and_scipy_objects import *  # noqa F403
else:
							from .schedulers import LMSDiscreteScheduler

try:
							if not (is_torch_available() and is_torchsde_available()):
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							from .utils.dummy_torch_and_torchsde_objects import *  # noqa F403
else:
							from .schedulers import DPMSolverSDEScheduler

try:
							if not (is_torch_available() and is_transformers_available()):
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							from .utils.dummy_torch_and_transformers_objects import *  # noqa F403
else:
							from .pipelines import (
							    AltDiffusionImgaImgPipeline,
							    AltDiffusionPipeline,
							    AudioLDMPipeline,
							    CycleDiffusionPipeline,
							    IFImgaImgPipeline,
							    IFImgaImgSuperResolutionPipeline,
							    IFInpaintingPipeline,
							    IFInpaintingSuperResolutionPipeline,
							    IFPipeline,
							    IFSuperResolutionPipeline,
							    ImageTextPipelineOutput,
							    KandinskyImgaImgPipeline,
							    KandinskyInpaintPipeline,
							    KandinskyPipeline,
							    KandinskyPriorPipeline,
							    KandinskyVaaControlnetImgaImgPipeline,
							    KandinskyVaaControlnetPipeline,
							    KandinskyVaaImgaImgPipeline,
							    KandinskyVaaInpaintPipeline,
							    KandinskyVaaPipeline,
							    KandinskyVaaPriorEmbaEmbPipeline,
							    KandinskyVaaPriorPipeline,
							    LDMTextToImagePipeline,
							    PaintByExamplePipeline,
							    SemanticStableDiffusionPipeline,
							    ShapEImgaImgPipeline,
							    ShapEPipeline,
							    StableDiffusionAttendAndExcitePipeline,
							    StableDiffusionControlNetImgaImgPipeline,
							    StableDiffusionControlNetInpaintPipeline,
							    StableDiffusionControlNetPipeline,
							    StableDiffusionDepthaImgPipeline,
							    StableDiffusionDiffEditPipeline,
							    StableDiffusionImageVariationPipeline,
							    StableDiffusionImgaImgPipeline,
							    StableDiffusionInpaintPipeline,
							    StableDiffusionInpaintPipelineLegacy,
							    StableDiffusionInstructPixaPixPipeline,
							    StableDiffusionLatentUpscalePipeline,
							    StableDiffusionLDMaDPipeline,
							    StableDiffusionModelEditingPipeline,
							    StableDiffusionPanoramaPipeline,
							    StableDiffusionParadigmsPipeline,
							    StableDiffusionPipeline,
							    StableDiffusionPipelineSafe,
							    StableDiffusionPixaPixZeroPipeline,
							    StableDiffusionSAGPipeline,
							    StableDiffusionUpscalePipeline,
							    StableUnCLIPImgaImgPipeline,
							    StableUnCLIPPipeline,
							    TextToVideoSDPipeline,
							    TextToVideoZeroPipeline,
							    UnCLIPImageVariationPipeline,
							    UnCLIPPipeline,
							    UniDiffuserModel,
							    UniDiffuserPipeline,
							    UniDiffuserTextDecoder,
							    VersatileDiffusionDualGuidedPipeline,
							    VersatileDiffusionImageVariationPipeline,
							    VersatileDiffusionPipeline,
							    VersatileDiffusionTextToImagePipeline,
							    VideoToVideoSDPipeline,
							    VQDiffusionPipeline,
							)

try:
							if not (is_torch_available() and is_transformers_available() and is_invisible_watermark_available()):
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							from .utils.dummy_torch_and_transformers_and_invisible_watermark_objects import *  # noqa F403
else:
							from .pipelines import StableDiffusionXLImgaImgPipeline, StableDiffusionXLPipeline

try:
							if not (is_torch_available() and is_transformers_available() and is_k_diffusion_available()):
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							from .utils.dummy_torch_and_transformers_and_k_diffusion_objects import *  # noqa F403
else:
							from .pipelines import StableDiffusionKDiffusionPipeline

try:
							if not (is_torch_available() and is_transformers_available() and is_onnx_available()):
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							from .utils.dummy_torch_and_transformers_and_onnx_objects import *  # noqa F403
else:
							from .pipelines import (
							    OnnxStableDiffusionImgaImgPipeline,
							    OnnxStableDiffusionInpaintPipeline,
							    OnnxStableDiffusionInpaintPipelineLegacy,
							    OnnxStableDiffusionPipeline,
							    OnnxStableDiffusionUpscalePipeline,
							    StableDiffusionOnnxPipeline,
							)

try:
							if not (is_torch_available() and is_librosa_available()):
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							from .utils.dummy_torch_and_librosa_objects import *  # noqa F403
else:
							from .pipelines import AudioDiffusionPipeline, Mel

try:
							if not (is_transformers_available() and is_torch_available() and is_note_seq_available()):
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							from .utils.dummy_transformers_and_torch_and_note_seq_objects import *  # noqa F403
else:
							from .pipelines import SpectrogramDiffusionPipeline

try:
							if not is_flax_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							from .utils.dummy_flax_objects import *  # noqa F403
else:
							from .models.controlnet_flax import FlaxControlNetModel
							from .models.modeling_flax_utils import FlaxModelMixin
							from .models.unet_ad_condition_flax import FlaxUNetaDConditionModel
							from .models.vae_flax import FlaxAutoencoderKL
							from .pipelines import FlaxDiffusionPipeline
							from .schedulers import (
							    FlaxDDIMScheduler,
							    FlaxDDPMScheduler,
							    FlaxDPMSolverMultistepScheduler,
							    FlaxKarrasVeScheduler,
							    FlaxLMSDiscreteScheduler,
							    FlaxPNDMScheduler,
							    FlaxSchedulerMixin,
							    FlaxScoreSdeVeScheduler,
							)


try:
							if not (is_flax_available() and is_transformers_available()):
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							from .utils.dummy_flax_and_transformers_objects import *  # noqa F403
else:
							from .pipelines import (
							    FlaxStableDiffusionControlNetPipeline,
							    FlaxStableDiffusionImgaImgPipeline,
							    FlaxStableDiffusionInpaintPipeline,
							    FlaxStableDiffusionPipeline,
							)

try:
							if not (is_note_seq_available()):
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							from .utils.dummy_note_seq_objects import *  # noqa F403
else:
							from .pipelines import MidiProcessor





