


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


_A		       =						logging.get_logger(__name__)

_A		       =						{
    's-JoL/Open-Llama-V1': 'https://huggingface.co/s-JoL/Open-Llama-V1/blob/main/config.json',
}






class     UpperCAmelCase__       (					A_		):



    """simple docstring"""






    UpperCAmelCase__						:		Any      =  "open-llama"






    def __init__(			self					,   A_=100000					,   A_=4096					,   A_=11008					,   A_=32					,   A_=32					,   A_="silu"					,   A_=2048					,   A_=0.02					,   A_=1E-6					,   A_=True					,   A_=0					,   A_=1					,   A_=2					,   A_=False					,   A_=True					,   A_=0.1					,   A_=0.1					,   A_=True					,   A_=True					,   A_=None					,   **A_					,   )  ->       List[Any]:
         __UpperCamelCase    							=vocab_size
         __UpperCamelCase    							=max_position_embeddings
         __UpperCamelCase    							=hidden_size
         __UpperCamelCase    							=intermediate_size
         __UpperCamelCase    							=num_hidden_layers
         __UpperCamelCase    							=num_attention_heads
         __UpperCamelCase    							=hidden_act
         __UpperCamelCase    							=initializer_range
         __UpperCamelCase    							=rms_norm_eps
         __UpperCamelCase    							=use_cache
         __UpperCamelCase    							=kwargs.pop(
             'use_memorry_efficient_attention'					,   A_    )
         __UpperCamelCase    							=hidden_dropout_prob
         __UpperCamelCase    							=attention_dropout_prob
         __UpperCamelCase    							=use_stable_embedding
         __UpperCamelCase    							=shared_input_output_embedding
         __UpperCamelCase    							=rope_scaling
         self._rope_scaling_validation()

         super().__init__(
             pad_token_id=A_					,   bos_token_id=A_					,   eos_token_id=A_					,   tie_word_embeddings=A_					,   **A_					,   )






    def _a					(			self    )  ->       List[str]:
         if self.rope_scaling is None:
              return

         if not isinstance(self.rope_scaling					,   A_    ) or len(self.rope_scaling    ) != 2:
              raise ValueError(
                  '`rope_scaling` must be a dictionary with with two fields, `name` and `factor`, '
                  f'got {self.rope_scaling}'    )
         __UpperCamelCase    							=self.rope_scaling.get('type'					,   A_    )
         __UpperCamelCase    							=self.rope_scaling.get('factor'					,   A_    )
         if rope_scaling_type is None or rope_scaling_type not in ["linear", "dynamic"]:
              raise ValueError(
                  f'`rope_scaling`\'s name field must be one of [\'linear\', \'dynamic\'], got {rope_scaling_type}'    )
         if rope_scaling_factor is None or not isinstance(A_					,   A_    ) or rope_scaling_factor <= 1.0:
              raise ValueError(f'`rope_scaling`\'s factor field must be an float > 1, got {rope_scaling_factor}'    )









# 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

# rely on isort to merge the imports
from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available


_A		       =						{
    'configuration_vivit': ['VIVIT_PRETRAINED_CONFIG_ARCHIVE_MAP', 'VivitConfig'],
}
try:
   if not is_vision_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   _A		       =						['VivitImageProcessor']


try:
   if not is_torch_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   _A		       =						[
       'VIVIT_PRETRAINED_MODEL_ARCHIVE_LIST',
       'VivitModel',
       'VivitPreTrainedModel',
       'VivitForVideoClassification',
   ]


if TYPE_CHECKING:
   from .configuration_vivit import VIVIT_PRETRAINED_CONFIG_ARCHIVE_MAP, VivitConfig

   try:
      if not is_vision_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .image_processing_vivit import VivitImageProcessor

   try:
      if not is_torch_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_vivit import (
          VIVIT_PRETRAINED_MODEL_ARCHIVE_LIST,
          VivitForVideoClassification,
          VivitModel,
          VivitPreTrainedModel,
      )


else:
   import sys

   _A		       =						_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)





