

'''simple docstring'''


from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


lowerCAmelCase__										= {
    "configuration_blip_2": [
        "BLIP_2_PRETRAINED_CONFIG_ARCHIVE_MAP",
        "Blip2Config",
        "Blip2QFormerConfig",
        "Blip2VisionConfig",
    ],
    "processing_blip_2": ["Blip2Processor"],
}

try:
						if not is_torch_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						lowerCAmelCase__										= [
						    "BLIP_2_PRETRAINED_MODEL_ARCHIVE_LIST",
						    "Blip2Model",
						    "Blip2QFormerModel",
						    "Blip2PreTrainedModel",
						    "Blip2ForConditionalGeneration",
						    "Blip2VisionModel",
						]

if TYPE_CHECKING:
						from .configuration_blip_a import (
						    BLIP_2_PRETRAINED_CONFIG_ARCHIVE_MAP,
						    BlipaConfig,
						    BlipaQFormerConfig,
						    BlipaVisionConfig,
						)
						from .processing_blip_a import BlipaProcessor

						try:
												if not is_torch_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_blip_a import (
												    BLIP_2_PRETRAINED_MODEL_ARCHIVE_LIST,
												    BlipaForConditionalGeneration,
												    BlipaModel,
												    BlipaPreTrainedModel,
												    BlipaQFormerModel,
												    BlipaVisionModel,
												)

else:
						import sys

						lowerCAmelCase__										= _LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)









'''simple docstring'''


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


lowerCAmelCase__										= logging.get_logger(__name__)

lowerCAmelCase__										= {
    "tanreinama/GPTSAN-2.8B-spout_is_uniform": (
        "https://huggingface.co/tanreinama/GPTSAN-2.8B-spout_is_uniform/resolve/main/config.json"
    ),
}



class 					lowercase						(  a_ ):
							_lowerCamelCase		:      Any=   "gptsan-japanese"
							_lowerCamelCase		:      List[Any]=   [
							    "past_key_values",
							]
							_lowerCamelCase		:      Tuple=   {
							    "hidden_size": "d_model",
							    "num_attention_heads": "num_heads",
							    "num_hidden_layers": "num_layers",
							}


							def __init__(			self    ,			_snake_case=3_6000    ,			_snake_case=1280    ,			_snake_case=1024    ,			_snake_case=8192    ,			_snake_case=4096    ,			_snake_case=128    ,			_snake_case=10    ,			_snake_case=0    ,			_snake_case=16    ,			_snake_case=16    ,			_snake_case=128    ,			_snake_case=0.0    ,			_snake_case=1e-5    ,			_snake_case=False    ,			_snake_case=0.0    ,			_snake_case="float32"    ,			_snake_case=False    ,			_snake_case=False    ,			_snake_case=False    ,			_snake_case=0.002    ,			_snake_case=False    ,			_snake_case=True    ,			_snake_case=3_5998    ,			_snake_case=3_5995    ,			_snake_case=3_5999    ,			**_snake_case    ,			)							->				Optional[int]:
								UpperCAmelCase_		:      Dict       	=					vocab_size
								UpperCAmelCase_		:      Optional[int]       	=					max_position_embeddings
								UpperCAmelCase_		:      Any       	=					d_model
								UpperCAmelCase_		:      int       	=					d_ff
								UpperCAmelCase_		:      Tuple       	=					d_ext
								UpperCAmelCase_		:      Tuple       	=					d_spout
								UpperCAmelCase_		:      List[Any]       	=					num_switch_layers
								UpperCAmelCase_		:      Tuple       	=					num_ext_layers
								UpperCAmelCase_		:      Optional[int]       	=					num_switch_layers + num_ext_layers
								UpperCAmelCase_		:      Tuple       	=					num_heads
								UpperCAmelCase_		:      List[str]       	=					num_experts
								UpperCAmelCase_		:      List[str]       	=					expert_capacity
								UpperCAmelCase_		:      Optional[int]       	=					dropout_rate
								UpperCAmelCase_		:      List[Any]       	=					layer_norm_epsilon
								UpperCAmelCase_		:      Any       	=					router_bias
								UpperCAmelCase_		:      Optional[Any]       	=					router_jitter_noise
								UpperCAmelCase_		:      str       	=					router_dtype
								UpperCAmelCase_		:      List[str]       	=					router_ignore_padding_tokens
								UpperCAmelCase_		:      Optional[int]       	=					output_hidden_states
								UpperCAmelCase_		:      Union[str, Any]       	=					output_attentions
								UpperCAmelCase_		:      Optional[int]       	=					initializer_factor
								UpperCAmelCase_		:      Optional[int]       	=					output_router_logits
								UpperCAmelCase_		:      List[str]       	=					use_cache

								super().__init__(
								    separator_token_id=_snake_case    ,			pad_token_id=_snake_case    ,			eos_token_id=_snake_case    ,			**_snake_case    ,			)






