'''simple docstring'''

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


UpperCamelCase__  :						Any					=      logging.get_logger(__name__)

UpperCamelCase__  :						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 					_lowercase						(   lowercase_ ):
      '''simple docstring'''


      UpperCAmelCase_   :   Optional[int]   				= '''falcon'''
      UpperCAmelCase_   :   Optional[Any]   				= ['''past_key_values''']




      def __init__(					self       ,lowerCamelCase_=65024       ,lowerCamelCase_=4544       ,lowerCamelCase_=32       ,lowerCamelCase_=71       ,lowerCamelCase_=1e-5       ,lowerCamelCase_=0.02       ,lowerCamelCase_=True       ,lowerCamelCase_=0.0       ,lowerCamelCase_=0.0       ,lowerCamelCase_=None       ,lowerCamelCase_=False       ,lowerCamelCase_=False       ,lowerCamelCase_=True       ,lowerCamelCase_=True       ,lowerCamelCase_=False       ,lowerCamelCase_=11       ,lowerCamelCase_=11       ,**lowerCamelCase_       ,)      ->      Tuple:



         '''simple docstring'''



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

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

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




      @property
      def 		lowerCAmelCase__       (					self				)      ->      List[Any]:



         '''simple docstring'''



         return self.hidden_size // self.num_attention_heads




      @property
      def 		lowerCAmelCase__       (					self				)      ->      Optional[Any]:



         '''simple docstring'''



         return not self.alibi












# Copyright 2023 The HuggingFace Inc. 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.
import re

from ..utils import cached_file


# docstyle-ignore
__a   :							Tuple						= "\nHuman: <<task>>\n\nAssistant: "


__a   :							Union[str, Any]						= "huggingface-tools/default-prompts"
__a   :							Optional[int]						= {"chat": "chat_prompt_template.txt", "run": "run_prompt_template.txt"}



def       _SCREAMING_SNAKE_CASE    (			__lowercase :      Tuple      ,					__lowercase :      Optional[Any]      ,					__lowercase :      List[Any]="run"     )    ->   Optional[int]:





    """simple docstring"""

    if prompt_or_repo_id is None:
        __A       =						DEFAULT_PROMPTS_REPO

    # prompt is considered a repo ID when it does not contain any kind of space
    if re.search("""\\s"""      ,					__lowercase     ) is not None:
        return prompt_or_repo_id

    __A       =						cached_file(
        __lowercase      ,					PROMPT_FILES[mode]      ,					repo_type="""dataset"""      ,					user_agent={"""agent""": agent_name}     )
    with open(__lowercase      ,					"""r"""      ,					encoding="""utf-8"""     ) as f:
        return f.read()




