





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


UpperCAmelCase__						:			List[str]									=logging.get_logger(__name__)

UpperCAmelCase__						:			Tuple									={
    '''tiiuae/falcon-40b''': '''https://huggingface.co/tiiuae/falcon-40b/resolve/main/config.json''',
    '''tiiuae/falcon-7b''': '''https://huggingface.co/tiiuae/falcon-7b/resolve/main/config.json''',
}

class       __A     (						a    ):
				__A      =				"""falcon"""
				__A      =				["""past_key_values"""]


				def __init__(		self   , UpperCAmelCase_=65024   , UpperCAmelCase_=4544   , UpperCAmelCase_=32   , UpperCAmelCase_=71   , UpperCAmelCase_=1E-5   , UpperCAmelCase_=0.0_2   , UpperCAmelCase_=True   , UpperCAmelCase_=0.0   , UpperCAmelCase_=0.0   , UpperCAmelCase_=None   , UpperCAmelCase_=False   , UpperCAmelCase_=False   , UpperCAmelCase_=True   , UpperCAmelCase_=True   , UpperCAmelCase_=False   , UpperCAmelCase_=11   , UpperCAmelCase_=11   , **UpperCAmelCase_   , ):
								lowerCamelCase	 =vocab_size
								# Backward compatibility with n_embed kwarg
								lowerCamelCase	 =kwargs.pop("""n_embed"""   , UpperCAmelCase_							)
								lowerCamelCase	 =hidden_size if n_embed is None else n_embed
								lowerCamelCase	 =num_hidden_layers
								lowerCamelCase	 =num_attention_heads
								lowerCamelCase	 =layer_norm_epsilon
								lowerCamelCase	 =initializer_range
								lowerCamelCase	 =use_cache
								lowerCamelCase	 =hidden_dropout
								lowerCamelCase	 =attention_dropout

								lowerCamelCase	 =bos_token_id
								lowerCamelCase	 =eos_token_id
								lowerCamelCase	 =num_attention_heads if num_kv_heads is None else num_kv_heads
								lowerCamelCase	 =alibi
								lowerCamelCase	 =new_decoder_architecture
								lowerCamelCase	 =multi_query  # Ignored when new_decoder_architecture is True
								lowerCamelCase	 =parallel_attn
								lowerCamelCase	 =bias

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


				@property
				def _snake_case       (		self							):
								return self.hidden_size // self.num_attention_heads


				@property
				def _snake_case       (		self							):
								return not self.alibi












from typing import TYPE_CHECKING

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


UpperCAmelCase__						:			List[Any]									={'''configuration_yolos''': ['''YOLOS_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''YolosConfig''', '''YolosOnnxConfig''']}

try:
							if not is_vision_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							UpperCAmelCase__						:			Dict									=['''YolosFeatureExtractor''']
							UpperCAmelCase__						:			List[Any]									=['''YolosImageProcessor''']

try:
							if not is_torch_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							UpperCAmelCase__						:			Optional[Any]									=[
							    '''YOLOS_PRETRAINED_MODEL_ARCHIVE_LIST''',
							    '''YolosForObjectDetection''',
							    '''YolosModel''',
							    '''YolosPreTrainedModel''',
							]


if TYPE_CHECKING:
							from .configuration_yolos import YOLOS_PRETRAINED_CONFIG_ARCHIVE_MAP, YolosConfig, YolosOnnxConfig

							try:
														if not is_vision_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .feature_extraction_yolos import YolosFeatureExtractor
														from .image_processing_yolos import YolosImageProcessor

							try:
														if not is_torch_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_yolos import (
														    YOLOS_PRETRAINED_MODEL_ARCHIVE_LIST,
														    YolosForObjectDetection,
														    YolosModel,
														    YolosPreTrainedModel,
														)


else:
							import sys

							UpperCAmelCase__						:			Optional[Any]									=_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)





