


"""simple docstring"""







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


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

lowerCamelCase_       :       List[Any]      						=  {}






class 				__A    (	_SCREAMING_SNAKE_CASE      ):






 """simple docstring"""




 __lowerCAmelCase			 =  "llama"
 __lowerCAmelCase			 =  ["past_key_values"]


 def __init__(		self			,   __A=3_2000			,   __A=4096			,   __A=1_1008			,   __A=32			,   __A=32			,   __A=None			,   __A="silu"			,   __A=2048			,   __A=0.02			,   __A=1E-6			,   __A=True			,   __A=0			,   __A=1			,   __A=2			,   __A=1			,   __A=False			,   __A=None			,   **__A			,   ) ->					str:
     a					=vocab_size
     a					=max_position_embeddings
     a					=hidden_size
     a					=intermediate_size
     a					=num_hidden_layers
     a					=num_attention_heads

     # for backward compatibility
     if num_key_value_heads is None:
         a					=num_attention_heads

     a					=num_key_value_heads
     a					=hidden_act
     a					=initializer_range
     a					=rms_norm_eps
     a					=pretraining_tp
     a					=use_cache
     a					=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 				SCREAMING_SNAKE_CASE							(		self						) ->					int:
     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}'''						)
     a					=self.rope_scaling.get('''type'''			,   __A						)
     a					=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}'''						)



"""simple docstring"""







from __future__ import annotations
def _A						(						lowercase	,   lowercase	,   lowercase	,   ):







    """simple docstring"""
    if (electron_conc, hole_conc, intrinsic_conc).count(0		) != 1:
        raise ValueError('''You cannot supply more or less than 2 values'''		)
    elif electron_conc < 0:
        raise ValueError('''Electron concentration cannot be negative in a semiconductor'''		)
    elif hole_conc < 0:
        raise ValueError('''Hole concentration cannot be negative in a semiconductor'''		)
    elif intrinsic_conc < 0:
        raise ValueError(
            '''Intrinsic concentration cannot be negative in a semiconductor'''		)
    elif electron_conc == 0:
        return (
            "electron_conc",
            intrinsic_conc**2 / hole_conc,
        )
    elif hole_conc == 0:
        return (
            "hole_conc",
            intrinsic_conc**2 / electron_conc,
        )
    elif intrinsic_conc == 0:
        return (
            "intrinsic_conc",
            (electron_conc * hole_conc) ** 0.5,
        )
    else:
        return (-1, -1)


if __name__ == "__main__":
       import doctest

       doctest.testmod()