



"""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__      =    {
    '''facebook/xglm-564M''': '''https://huggingface.co/facebook/xglm-564M/resolve/main/config.json''',
    # See all XGLM models at https://huggingface.co/models?filter=xglm
}






class 	__snake_case	(     _lowercase):
  snake_case__    :       List[Any]        =						"xglm"
  snake_case__    :       Dict        =						["past_key_values"]

  snake_case__    :       str        =						{
      "num_attention_heads": "attention_heads",
      "hidden_size": "d_model",
      "num_hidden_layers": "num_layers",
  }




  def __init__(			self					:						List[str]						, __lowerCAmelCase					:						List[Any]=2_5_6_0_0_8						, __lowerCAmelCase					:						int=2_0_4_8						, __lowerCAmelCase					:						Dict=1_0_2_4						, __lowerCAmelCase					:						List[str]=4_0_9_6						, __lowerCAmelCase					:						Tuple=2_4						, __lowerCAmelCase					:						Dict=1_6						, __lowerCAmelCase					:						Tuple="gelu"						, __lowerCAmelCase					:						Tuple=0.1						, __lowerCAmelCase					:						Tuple=0.1						, __lowerCAmelCase					:						Optional[Any]=0.0						, __lowerCAmelCase					:						List[Any]=0.0						, __lowerCAmelCase					:						int=0.02						, __lowerCAmelCase					:						Any=True						, __lowerCAmelCase					:						Tuple=True						, __lowerCAmelCase					:						str=2						, __lowerCAmelCase					:						Dict=1						, __lowerCAmelCase					:						Dict=0						, __lowerCAmelCase					:						List[Any]=2						, **__lowerCAmelCase					:						Optional[Any]						, ):






         """simple docstring"""






         _lowerCamelCase						:    List[Any]         =			vocab_size
         _lowerCamelCase						:    List[Any]         =			max_position_embeddings
         _lowerCamelCase						:    int         =			d_model
         _lowerCamelCase						:    Optional[Any]         =			ffn_dim
         _lowerCamelCase						:    Any         =			num_layers
         _lowerCamelCase						:    Union[str, Any]         =			attention_heads
         _lowerCamelCase						:    List[str]         =			activation_function
         _lowerCamelCase						:    Union[str, Any]         =			dropout
         _lowerCamelCase						:    int         =			attention_dropout
         _lowerCamelCase						:    Optional[int]         =			activation_dropout
         _lowerCamelCase						:    Any         =			layerdrop
         _lowerCamelCase						:    List[str]         =			init_std
         _lowerCamelCase						:    Union[str, Any]         =			scale_embedding  # scale factor will be sqrt(d_model) if True
         _lowerCamelCase						:    str         =			use_cache

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


