jradchenko/DeciCoder-1b
017
1from packaging import version2import transformers3if version.parse(transformers.__version__) < version.parse("4.31.0"):4 raise ImportError(5 f"You are using transformers=={transformers.__version__}, but transformers>=4.31.0 is required to use DeciCoder. Please upgrade transformers."6 )7from transformers.models.llama.configuration_llama import LlamaConfig8from transformers.utils import logging9 10 11logger = logging.get_logger(__name__)12 13LLAMA_PRETRAINED_CONFIG_ARCHIVE_MAP = {}14 15 16class LlamaConfig(LlamaConfig):17 r"""18 This is the configuration class to store the configuration of a [`LlamaModel`]. It is used to instantiate an LLaMA19 model according to the specified arguments, defining the model architecture. Instantiating a configuration with the20 defaults will yield a similar configuration to that of the LLaMA-7B.21 22 Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the23 documentation from [`PretrainedConfig`] for more information.24 25 26 Args:27 naive_attention_prefill (`bool`, *optional*, defaults to False):28 Whether to use naive matmul or scaled dot product attention during prefill.29 naive_attention_decode_batched (`bool`, *optional*, defaults to True):30 Whether to use naive matmul or scaled dot product attention during decode for batch_size > 1.31 naive_attention_decode_single (`bool`, *optional*, defaults to False):32 Whether to use naive matmul or scaled dot product attention during decode for batch_size == 1.33 34 35 ```"""36 keys_to_ignore_at_inference = ["past_key_values"]37 38 def __init__(39 self,40 naive_attention_prefill: bool = False,41 naive_attention_decode_batched: bool = True,42 naive_attention_decode_single: bool = False,43 **kwargs,44 ):45 self.naive_attention_prefill = naive_attention_prefill46 self.naive_attention_decode_batched = naive_attention_decode_batched47 self.naive_attention_decode_single = naive_attention_decode_single48 49 super().__init__(**kwargs,)50 51 