




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


_lowerCAmelCase						:   Tuple		=   logging.get_logger(__name__)

_lowerCAmelCase						:   List[Any]		=   {
    "bigcode/gpt_bigcode-santacoder": "https://huggingface.co/bigcode/gpt_bigcode-santacoder/resolve/main/config.json",
}
class 			_UpperCamelCase      (				lowerCAmelCase		):
      UpperCAmelCase_        =		"""gpt_bigcode"""
      UpperCAmelCase_        =		["""past_key_values"""]
      UpperCAmelCase_        =		{
          """hidden_size""": """n_embd""",
          """max_position_embeddings""": """n_positions""",
          """num_attention_heads""": """n_head""",
          """num_hidden_layers""": """n_layer""",
      }
      def __init__(			self   :Optional[Any] ,      lowerCamelCase   :Any=5_0257 ,      lowerCamelCase   :int=1024 ,      lowerCamelCase   :int=768 ,      lowerCamelCase   :Optional[int]=12 ,      lowerCamelCase   :List[Any]=12 ,      lowerCamelCase   :Union[str, Any]=None ,      lowerCamelCase   :Optional[int]="gelu_pytorch_tanh" ,      lowerCamelCase   :Optional[int]=0.1 ,      lowerCamelCase   :Any=0.1 ,      lowerCamelCase   :List[Any]=0.1 ,      lowerCamelCase   :str=1e-5 ,      lowerCamelCase   :Dict=0.02 ,      lowerCamelCase   :Any=True ,      lowerCamelCase   :List[Any]=True ,      lowerCamelCase   :int=5_0256 ,      lowerCamelCase   :Union[str, Any]=5_0256 ,      lowerCamelCase   :Optional[int]=True ,      lowerCamelCase   :Optional[Any]=True ,      lowerCamelCase   :Optional[Any]=True ,      **lowerCamelCase   :Optional[Any] ,      )     ->			Any:
       UpperCAmelCase__							 =						vocab_size
       UpperCAmelCase__							 =						n_positions
       UpperCAmelCase__							 =						n_embd
       UpperCAmelCase__							 =						n_layer
       UpperCAmelCase__							 =						n_head
       UpperCAmelCase__							 =						n_inner
       UpperCAmelCase__							 =						activation_function
       UpperCAmelCase__							 =						resid_pdrop
       UpperCAmelCase__							 =						embd_pdrop
       UpperCAmelCase__							 =						attn_pdrop
       UpperCAmelCase__							 =						layer_norm_epsilon
       UpperCAmelCase__							 =						initializer_range
       UpperCAmelCase__							 =						scale_attn_weights
       UpperCAmelCase__							 =						use_cache
       UpperCAmelCase__							 =						attention_softmax_in_fpaa
       UpperCAmelCase__							 =						scale_attention_softmax_in_fpaa
       UpperCAmelCase__							 =						multi_query

       UpperCAmelCase__							 =						bos_token_id
       UpperCAmelCase__							 =						eos_token_id

       super().__init__(bos_token_id=lowerCamelCase ,      eos_token_id=lowerCamelCase ,      **lowerCamelCase      )











from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available


_lowerCAmelCase						:   Optional[int]		=   {
    "configuration_maskformer": ["MASKFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", "MaskFormerConfig"],
    "configuration_maskformer_swin": ["MaskFormerSwinConfig"],
}

try:
  if not is_vision_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  _lowerCAmelCase						:   Optional[int]		=   ["MaskFormerFeatureExtractor"]
  _lowerCAmelCase						:   Dict		=   ["MaskFormerImageProcessor"]


try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  _lowerCAmelCase						:   int		=   [
      "MASKFORMER_PRETRAINED_MODEL_ARCHIVE_LIST",
      "MaskFormerForInstanceSegmentation",
      "MaskFormerModel",
      "MaskFormerPreTrainedModel",
  ]
  _lowerCAmelCase						:   List[str]		=   [
      "MaskFormerSwinBackbone",
      "MaskFormerSwinModel",
      "MaskFormerSwinPreTrainedModel",
  ]

if TYPE_CHECKING:
  from .configuration_maskformer import MASKFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, MaskFormerConfig
  from .configuration_maskformer_swin import MaskFormerSwinConfig

  try:
    if not is_vision_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .feature_extraction_maskformer import MaskFormerFeatureExtractor
    from .image_processing_maskformer import MaskFormerImageProcessor
  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_maskformer import (
        MASKFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
        MaskFormerForInstanceSegmentation,
        MaskFormerModel,
        MaskFormerPreTrainedModel,
    )
    from .modeling_maskformer_swin import (
        MaskFormerSwinBackbone,
        MaskFormerSwinModel,
        MaskFormerSwinPreTrainedModel,
    )


else:
  import sys

  _lowerCAmelCase						:   str		=   _LazyModule(__name__, globals()["__file__"], _import_structure)





