
"""simple docstring"""





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


_a		       =							logging.get_logger(__name__)

_a		       =							{
    '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 A_	(lowercase__      ):




  '''simple docstring'''
  SCREAMING_SNAKE_CASE__			:						int       =		"""falcon"""
  SCREAMING_SNAKE_CASE__			:						Optional[int]       =		["""past_key_values"""]







  def __init__(		self				,   lowercase_=6_5024				,   lowercase_=4544				,   lowercase_=32				,   lowercase_=71				,   lowercase_=1E-5				,   lowercase_=0.02				,   lowercase_=True				,   lowercase_=0.0				,   lowercase_=0.0				,   lowercase_=None				,   lowercase_=False				,   lowercase_=False				,   lowercase_=True				,   lowercase_=True				,   lowercase_=False				,   lowercase_=11				,   lowercase_=11				,   **lowercase_				,   ):

     """simple docstring"""
     UpperCAmelCase_					:					str			     =    vocab_size
     # Backward compatibility with n_embed kwarg
     UpperCAmelCase_					:					Dict			     =    kwargs.pop("n_embed"				,   lowercase_  )
     UpperCAmelCase_					:					Any			     =    hidden_size if n_embed is None else n_embed
     UpperCAmelCase_					:					Union[str, Any]			     =    num_hidden_layers
     UpperCAmelCase_					:					List[Any]			     =    num_attention_heads
     UpperCAmelCase_					:					str			     =    layer_norm_epsilon
     UpperCAmelCase_					:					int			     =    initializer_range
     UpperCAmelCase_					:					List[str]			     =    use_cache
     UpperCAmelCase_					:					List[Any]			     =    hidden_dropout
     UpperCAmelCase_					:					List[Any]			     =    attention_dropout

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

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







  @property
  def        UpperCamelCase__					(		self  ):

     """simple docstring"""
     return self.hidden_size // self.num_attention_heads







  @property
  def        UpperCamelCase__					(		self  ):

     """simple docstring"""
     return not self.alibi



import unittest
from dataclasses import dataclass

import pytest

from accelerate.commands.config.config_args import SageMakerConfig
from accelerate.utils import ComputeEnvironment
from accelerate.utils.launch import _convert_nargs_to_dict







@dataclass
class __snake_case				(						lowerCamelCase_		):
   lowerCAmelCase_														=							ComputeEnvironment.AMAZON_SAGEMAKER
   lowerCAmelCase_														=							True
   lowerCAmelCase_														=							"ml.p3.2xlarge"
   lowerCAmelCase_														=							"accelerate_sagemaker_execution_role"
   lowerCAmelCase_														=							"hf-sm"
   lowerCAmelCase_														=							"us-east-1"
   lowerCAmelCase_														=							1
   lowerCAmelCase_														=							"accelerate-sagemaker-1"
   lowerCAmelCase_														=							"1.6"
   lowerCAmelCase_														=							"4.4"
   lowerCAmelCase_														=							"train.py"
   lowerCAmelCase_														=							[
       "--model_name_or_path",
       "bert",
       "--do_train",
       "False",
       "--epochs",
       "3",
       "--learning_rate",
       "5e-5",
       "--max_steps",
       "50.5",
   ]
   lowerCAmelCase_														=							[
       "--model_name_or_path",
       "bert",
       "--do_train",
       "--do_test",
       "False",
       "--do_predict",
       "--epochs",
       "3",
       "--learning_rate",
       "5e-5",
       "--max_steps",
       "50.5",
   ]







class __snake_case				(						unittest.TestCase		):




   def 	__a						(    self			:				List[Any]      ):



     """simple docstring"""






     SCREAMING_SNAKE_CASE__										=      _convert_nargs_to_dict(MockLaunchConfig.success_training_script_args      )
     assert isinstance(converted_args["""model_name_or_path"""]       ,	_lowercase      )
     assert isinstance(converted_args["""do_train"""]       ,	_lowercase      )
     assert isinstance(converted_args["""epochs"""]       ,	_lowercase      )
     assert isinstance(converted_args["""learning_rate"""]       ,	_lowercase      )
     assert isinstance(converted_args["""max_steps"""]       ,	_lowercase      )

     with pytest.raises(_lowercase      ):
       _convert_nargs_to_dict(MockLaunchConfig.fail_training_script_args      )
