




"""simple docstring"""





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


A   =       logging.get_logger(__name__)

A   =       {
    """abeja/gpt-neox-japanese-2.7b""": """https://huggingface.co/abeja/gpt-neox-japanese-2.7b/resolve/main/config.json""",
}



class      a__				(	__magic_name__   ):
			lowercase_    =	"gpt_neox_japanese"


			def __init__(      self      :    Union[str, Any]      ,  UpperCamelCase_      :    Any=32000      ,  UpperCamelCase_      :    int=2560      ,  UpperCamelCase_      :    Optional[Any]=32      ,  UpperCamelCase_      :    Tuple=32      ,  UpperCamelCase_      :    Any=4      ,  UpperCamelCase_      :    Tuple="gelu"      ,  UpperCamelCase_      :    List[str]=1.00      ,  UpperCamelCase_      :    List[str]=10000      ,  UpperCamelCase_      :    Any=2048      ,  UpperCamelCase_      :    Union[str, Any]=0.02      ,  UpperCamelCase_      :    Union[str, Any]=1e-5      ,  UpperCamelCase_      :    int=True      ,  UpperCamelCase_      :    Union[str, Any]=31996      ,  UpperCamelCase_      :    Tuple=31999      ,  UpperCamelCase_      :    Optional[int]=0.1      ,  UpperCamelCase_      :    List[Any]=0.0      ,  **UpperCamelCase_      :    Dict      ,  ):


						"""simple docstring"""




						super().__init__(bos_token_id=UpperCamelCase_      ,  eos_token_id=UpperCamelCase_      ,  **UpperCamelCase_)
						__UpperCAmelCase	: List[str]		=					vocab_size
						__UpperCAmelCase	: str		=					max_position_embeddings
						__UpperCAmelCase	: int		=					hidden_size
						__UpperCAmelCase	: Dict		=					num_hidden_layers
						__UpperCAmelCase	: str		=					num_attention_heads
						__UpperCAmelCase	: List[Any]		=					intermediate_multiple_size
						__UpperCAmelCase	: str		=					hidden_act
						__UpperCAmelCase	: Any		=					rotary_pct
						__UpperCAmelCase	: str		=					rotary_emb_base
						__UpperCAmelCase	: List[Any]		=					initializer_range
						__UpperCAmelCase	: Tuple		=					layer_norm_eps
						__UpperCAmelCase	: Tuple		=					use_cache
						__UpperCAmelCase	: str		=					attention_dropout
						__UpperCAmelCase	: List[str]		=					hidden_dropout








"""simple docstring"""





import json
import os
import tempfile

from transformers.testing_utils import check_json_file_has_correct_format



class      a__				:
			lowercase_    =	None


			def       a_     (      self      :    List[Any]):


						"""simple docstring"""




						__UpperCAmelCase	: Optional[Any]		=					self.feature_extraction_class(**self.feat_extract_dict)
						__UpperCAmelCase	: Any		=					json.loads(feat_extract.to_json_string())
						for key, value in self.feat_extract_dict.items():
									self.assertEqual(obj[key]      ,  UpperCamelCase_)


			def       a_     (      self      :    Tuple):


						"""simple docstring"""




						__UpperCAmelCase	: Optional[Any]		=					self.feature_extraction_class(**self.feat_extract_dict)

						with tempfile.TemporaryDirectory() as tmpdirname:
									__UpperCAmelCase	: Dict		=					os.path.join(UpperCamelCase_      ,  "feat_extract.json")
									feat_extract_first.to_json_file(UpperCamelCase_)
									__UpperCAmelCase	: Optional[Any]		=					self.feature_extraction_class.from_json_file(UpperCamelCase_)

						self.assertEqual(feat_extract_second.to_dict()      ,  feat_extract_first.to_dict())


			def       a_     (      self      :    List[str]):


						"""simple docstring"""




						__UpperCAmelCase	: Optional[Any]		=					self.feature_extraction_class(**self.feat_extract_dict)

						with tempfile.TemporaryDirectory() as tmpdirname:
									__UpperCAmelCase	: Tuple		=					feat_extract_first.save_pretrained(UpperCamelCase_)[0]
									check_json_file_has_correct_format(UpperCamelCase_)
									__UpperCAmelCase	: List[Any]		=					self.feature_extraction_class.from_pretrained(UpperCamelCase_)

						self.assertEqual(feat_extract_second.to_dict()      ,  feat_extract_first.to_dict())


			def       a_     (      self      :    Union[str, Any]):


						"""simple docstring"""




						__UpperCAmelCase	: Union[str, Any]		=					self.feature_extraction_class()
						self.assertIsNotNone(UpperCamelCase_)


