


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


__UpperCamelCase    :						Tuple     =							logging.get_logger(__name__)

__UpperCamelCase    :						List[Any]     =							{
    '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 							_UpperCamelCase (						A						):

 '''simple docstring'''







 a_				:							int    = """falcon"""
 a_				:							Tuple    = ["""past_key_values"""]

 def __init__(  self  : List[Any]       ,  _lowerCamelCase  : Optional[int]=6_5_0_2_4       ,  _lowerCamelCase  : Optional[Any]=4_5_4_4       ,  _lowerCamelCase  : Optional[int]=3_2       ,  _lowerCamelCase  : Dict=7_1       ,  _lowerCamelCase  : List[str]=1E-5       ,  _lowerCamelCase  : int=0.02       ,  _lowerCamelCase  : Tuple=True       ,  _lowerCamelCase  : Optional[int]=0.0       ,  _lowerCamelCase  : Tuple=0.0       ,  _lowerCamelCase  : int=None       ,  _lowerCamelCase  : int=False       ,  _lowerCamelCase  : Optional[Any]=False       ,  _lowerCamelCase  : Optional[Any]=True       ,  _lowerCamelCase  : List[str]=True       ,  _lowerCamelCase  : int=False       ,  _lowerCamelCase  : Any=1_1       ,  _lowerCamelCase  : str=1_1       ,  **_lowerCamelCase  : str       ,  ):






       '''simple docstring'''



       __lowerCamelCase     :      Optional[Any]       						=						vocab_size
       # Backward compatibility with n_embed kwarg
       __lowerCamelCase     :      List[str]       						=						kwargs.pop("""n_embed"""       ,  _lowerCamelCase							)
       __lowerCamelCase     :      Dict       						=						hidden_size if n_embed is None else n_embed
       __lowerCamelCase     :      str       						=						num_hidden_layers
       __lowerCamelCase     :      int       						=						num_attention_heads
       __lowerCamelCase     :      Tuple       						=						layer_norm_epsilon
       __lowerCamelCase     :      Optional[int]       						=						initializer_range
       __lowerCamelCase     :      Dict       						=						use_cache
       __lowerCamelCase     :      str       						=						hidden_dropout
       __lowerCamelCase     :      Optional[int]       						=						attention_dropout

       __lowerCamelCase     :      int       						=						bos_token_id
       __lowerCamelCase     :      Union[str, Any]       						=						eos_token_id
       __lowerCamelCase     :      Union[str, Any]       						=						num_attention_heads if num_kv_heads is None else num_kv_heads
       __lowerCamelCase     :      Any       						=						alibi
       __lowerCamelCase     :      int       						=						new_decoder_architecture
       __lowerCamelCase     :      List[str]       						=						multi_query  # Ignored when new_decoder_architecture is True
       __lowerCamelCase     :      Union[str, Any]       						=						parallel_attn
       __lowerCamelCase     :      List[Any]       						=						bias

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

 @property
 def   _snake_case    (  self  : List[Any]							):






       '''simple docstring'''



       return self.hidden_size // self.num_attention_heads


 @property
 def   _snake_case    (  self  : int							):






       '''simple docstring'''



       return not self.alibi







# Copyright 2023 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


__UpperCamelCase    :						Any     =							{
    'configuration_mgp_str': ['MGP_STR_PRETRAINED_CONFIG_ARCHIVE_MAP', 'MgpstrConfig'],
    'processing_mgp_str': ['MgpstrProcessor'],
    'tokenization_mgp_str': ['MgpstrTokenizer'],
}

try:
    if not is_torch_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    __UpperCamelCase    :						Tuple     =							[
        'MGP_STR_PRETRAINED_MODEL_ARCHIVE_LIST',
        'MgpstrModel',
        'MgpstrPreTrainedModel',
        'MgpstrForSceneTextRecognition',
    ]

if TYPE_CHECKING:
    from .configuration_mgp_str import MGP_STR_PRETRAINED_CONFIG_ARCHIVE_MAP, MgpstrConfig
    from .processing_mgp_str import MgpstrProcessor
    from .tokenization_mgp_str import MgpstrTokenizer

    try:
        if not is_torch_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .modeling_mgp_str import (
            MGP_STR_PRETRAINED_MODEL_ARCHIVE_LIST,
            MgpstrForSceneTextRecognition,
            MgpstrModel,
            MgpstrPreTrainedModel,
        )
else:
    import sys

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



