




from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_sentencepiece_available,
    is_speech_available,
    is_torch_available,
)


_lowerCamelCase					:     str					  =  {
    "configuration_speech_to_text_2": ["SPEECH_TO_TEXT_2_PRETRAINED_CONFIG_ARCHIVE_MAP", "Speech2Text2Config"],
    "processing_speech_to_text_2": ["Speech2Text2Processor"],
    "tokenization_speech_to_text_2": ["Speech2Text2Tokenizer"],
}


try:
	if not is_torch_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	_lowerCamelCase					:     List[Any]					  =  [
	    "SPEECH_TO_TEXT_2_PRETRAINED_MODEL_ARCHIVE_LIST",
	    "Speech2Text2ForCausalLM",
	    "Speech2Text2PreTrainedModel",
	]


if TYPE_CHECKING:
	from .configuration_speech_to_text_a import SPEECH_TO_TEXT_2_PRETRAINED_CONFIG_ARCHIVE_MAP, SpeechaTextaConfig
	from .processing_speech_to_text_a import SpeechaTextaProcessor
	from .tokenization_speech_to_text_a import SpeechaTextaTokenizer

	try:
		if not is_torch_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .modeling_speech_to_text_a import (
		    SPEECH_TO_TEXT_2_PRETRAINED_MODEL_ARCHIVE_LIST,
		    SpeechaTextaForCausalLM,
		    SpeechaTextaPreTrainedModel,
		)

else:
	import sys

	_lowerCamelCase					:     Optional[int]					  =  _LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)







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


_lowerCamelCase					:     Optional[Any]					  =  logging.get_logger(__name__)

_lowerCamelCase					:     str					  =  {
    "google/reformer-crime-and-punishment": (
        "https://huggingface.co/google/reformer-crime-and-punishment/resolve/main/config.json"
    ),
    "google/reformer-enwik8": "https://huggingface.co/google/reformer-enwik8/resolve/main/config.json",
}
class 				__snake_case     (_a						):
				lowerCAmelCase__			=   "reformer"
				lowerCAmelCase__			=   ["past_buckets_states"]
				lowerCAmelCase__			=   {}



				def __init__(					self					:						Optional[int]						,		_UpperCAmelCase					:						str=64						,		_UpperCAmelCase					:						Tuple=["local", "lsh", "local", "lsh", "local", "lsh"]						,		_UpperCAmelCase					:						Optional[int]=1.0						,		_UpperCAmelCase					:						str=True						,		_UpperCAmelCase					:						List[Any]=[64, 64]						,		_UpperCAmelCase					:						str=[64, 192]						,		_UpperCAmelCase					:						List[Any]=0						,		_UpperCAmelCase					:						Optional[Any]=2						,		_UpperCAmelCase					:						Dict=512						,		_UpperCAmelCase					:						Optional[int]=None						,		_UpperCAmelCase					:						Tuple="relu"						,		_UpperCAmelCase					:						Tuple=0.05						,		_UpperCAmelCase					:						int=256						,		_UpperCAmelCase					:						List[str]=0.02						,		_UpperCAmelCase					:						Any=False						,		_UpperCAmelCase					:						Any=1E-12						,		_UpperCAmelCase					:						List[Any]=1						,		_UpperCAmelCase					:						Optional[Any]=0						,		_UpperCAmelCase					:						Union[str, Any]=0.05						,		_UpperCAmelCase					:						int=64						,		_UpperCAmelCase					:						List[str]=64						,		_UpperCAmelCase					:						Any=0.0						,		_UpperCAmelCase					:						Any=1						,		_UpperCAmelCase					:						Optional[Any]=0						,		_UpperCAmelCase					:						Union[str, Any]=4096						,		_UpperCAmelCase					:						Dict=12						,		_UpperCAmelCase					:						int=None						,		_UpperCAmelCase					:						List[Any]=1						,		_UpperCAmelCase					:						Union[str, Any]=0						,		_UpperCAmelCase					:						Any=320						,		_UpperCAmelCase					:						Any=False						,		_UpperCAmelCase					:						List[str]=True						,		_UpperCAmelCase					:						Optional[int]=None						,		**_UpperCAmelCase					:						Tuple						,		)     ->			List[str]:





								'''simple docstring'''




								_lowerCAmelCase			:			Union[str, Any]        =					hash_seed
								_lowerCAmelCase			:			int        =					vocab_size
								_lowerCAmelCase			:			Optional[Any]        =					attention_head_size
								_lowerCAmelCase			:			Dict        =					hidden_size
								_lowerCAmelCase			:			Union[str, Any]        =					num_attention_heads
								_lowerCAmelCase			:			int        =					num_hashes
								_lowerCAmelCase			:			Union[str, Any]        =					len(_UpperCAmelCase					)
								_lowerCAmelCase			:			int        =					tuple(_UpperCAmelCase					) if isinstance(_UpperCAmelCase						,		_UpperCAmelCase					) else num_buckets
								_lowerCAmelCase			:			Union[str, Any]        =					lsh_attn_chunk_length
								_lowerCAmelCase			:			List[str]        =					local_attn_chunk_length
								_lowerCAmelCase			:			int        =					lsh_num_chunks_after
								_lowerCAmelCase			:			Union[str, Any]        =					lsh_num_chunks_before
								_lowerCAmelCase			:			str        =					local_num_chunks_after
								_lowerCAmelCase			:			Dict        =					local_num_chunks_before
								_lowerCAmelCase			:			Any        =					hidden_act
								_lowerCAmelCase			:			List[str]        =					feed_forward_size
								_lowerCAmelCase			:			str        =					hidden_dropout_prob
								_lowerCAmelCase			:			Any        =					lsh_attention_probs_dropout_prob
								_lowerCAmelCase			:			Dict        =					local_attention_probs_dropout_prob
								_lowerCAmelCase			:			Tuple        =					max_position_embeddings
								_lowerCAmelCase			:			Any        =					initializer_range
								_lowerCAmelCase			:			List[str]        =					layer_norm_eps
								_lowerCAmelCase			:			Dict        =					axial_pos_embds
								_lowerCAmelCase			:			Union[str, Any]        =					tuple(_UpperCAmelCase					)
								_lowerCAmelCase			:			int        =					tuple(_UpperCAmelCase					)
								_lowerCAmelCase			:			List[str]        =					axial_norm_std
								_lowerCAmelCase			:			List[str]        =					chunk_size_lm_head
								_lowerCAmelCase			:			int        =					attn_layers
								_lowerCAmelCase			:			List[Any]        =					use_cache
								_lowerCAmelCase			:			Optional[int]        =					classifier_dropout
								super().__init__(
								    pad_token_id=_UpperCAmelCase						,		eos_token_id=_UpperCAmelCase						,		is_decoder=_UpperCAmelCase						,		tie_word_embeddings=_UpperCAmelCase						,		**_UpperCAmelCase						,		)

