






import os
import sys
import unittest


A:      Any  				=				os.path.abspath(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
sys.path.append(os.path.join(git_repo_path, "utils"))

import get_test_info  # noqa: E402
from get_test_info import (  # noqa: E402
    get_model_to_test_mapping,
    get_model_to_tester_mapping,
    get_test_to_tester_mapping,
)


A:      Any  				=				os.path.join("tests", "models", "bert", "test_modeling_bert.py")
A:      Optional[int]  				=				os.path.join("tests", "models", "blip", "test_modeling_blip.py")






class 							__magic_name__     (	unittest.TestCase				):







	"""simple docstring"""



	def        lowerCamelCase__		(							self       )						->  Optional[int]:
							lowercase_      :   Union[str, Any]        =			get_test_to_tester_mapping(_lowercase       )
							lowercase_      :   List[str]        =			get_test_to_tester_mapping(_lowercase       )

							lowercase_      :   List[str]        =			{'BertModelTest': 'BertModelTester'}

							lowercase_      :   Dict        =			{
							    'BlipModelTest': 'BlipModelTester',
							    'BlipTextImageModelTest': 'BlipTextImageModelsModelTester',
							    'BlipTextModelTest': 'BlipTextModelTester',
							    'BlipTextRetrievalModelTest': 'BlipTextRetrievalModelTester',
							    'BlipVQAModelTest': 'BlipVQAModelTester',
							    'BlipVisionModelTest': 'BlipVisionModelTester',
							}

							self.assertEqual(get_test_info.to_json(_lowercase       )  ,      _lowercase       )
							self.assertEqual(get_test_info.to_json(_lowercase       )  ,      _lowercase       )
	def        lowerCamelCase__		(							self       )						->  Dict:
							lowercase_      :   Dict        =			get_model_to_test_mapping(_lowercase       )
							lowercase_      :   Union[str, Any]        =			get_model_to_test_mapping(_lowercase       )

							lowercase_      :   Optional[int]        =			{
							    'BertForMaskedLM': ['BertModelTest'],
							    'BertForMultipleChoice': ['BertModelTest'],
							    'BertForNextSentencePrediction': ['BertModelTest'],
							    'BertForPreTraining': ['BertModelTest'],
							    'BertForQuestionAnswering': ['BertModelTest'],
							    'BertForSequenceClassification': ['BertModelTest'],
							    'BertForTokenClassification': ['BertModelTest'],
							    'BertLMHeadModel': ['BertModelTest'],
							    'BertModel': ['BertModelTest'],
							}

							lowercase_      :   str        =			{
							    'BlipForConditionalGeneration': ['BlipTextImageModelTest'],
							    'BlipForImageTextRetrieval': ['BlipTextRetrievalModelTest'],
							    'BlipForQuestionAnswering': ['BlipVQAModelTest'],
							    'BlipModel': ['BlipModelTest'],
							    'BlipTextModel': ['BlipTextModelTest'],
							    'BlipVisionModel': ['BlipVisionModelTest'],
							}

							self.assertEqual(get_test_info.to_json(_lowercase       )  ,      _lowercase       )
							self.assertEqual(get_test_info.to_json(_lowercase       )  ,      _lowercase       )







	def        lowerCamelCase__		(							self       )						->  Optional[int]:
							lowercase_      :   List[str]        =			get_model_to_tester_mapping(_lowercase       )
							lowercase_      :   Union[str, Any]        =			get_model_to_tester_mapping(_lowercase       )

							lowercase_      :   Union[str, Any]        =			{
							    'BertForMaskedLM': ['BertModelTester'],
							    'BertForMultipleChoice': ['BertModelTester'],
							    'BertForNextSentencePrediction': ['BertModelTester'],
							    'BertForPreTraining': ['BertModelTester'],
							    'BertForQuestionAnswering': ['BertModelTester'],
							    'BertForSequenceClassification': ['BertModelTester'],
							    'BertForTokenClassification': ['BertModelTester'],
							    'BertLMHeadModel': ['BertModelTester'],
							    'BertModel': ['BertModelTester'],
							}

							lowercase_      :   Optional[Any]        =			{
							    'BlipForConditionalGeneration': ['BlipTextImageModelsModelTester'],
							    'BlipForImageTextRetrieval': ['BlipTextRetrievalModelTester'],
							    'BlipForQuestionAnswering': ['BlipVQAModelTester'],
							    'BlipModel': ['BlipModelTester'],
							    'BlipTextModel': ['BlipTextModelTester'],
							    'BlipVisionModel': ['BlipVisionModelTester'],
							}

							self.assertEqual(get_test_info.to_json(_lowercase       )  ,      _lowercase       )
							self.assertEqual(get_test_info.to_json(_lowercase       )  ,      _lowercase       )








'''simple docstring'''

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


A:      int  				=				logging.get_logger(__name__)

A:      int  				=				{
    "bigcode/gpt_bigcode-santacoder": "https://huggingface.co/bigcode/gpt_bigcode-santacoder/resolve/main/config.json",
}






class 							__magic_name__     (	UpperCAmelCase_				):







	"""simple docstring"""



	SCREAMING_SNAKE_CASE_					:      List[str]        =  'gpt_bigcode'
	SCREAMING_SNAKE_CASE_					:      int        =  ['past_key_values']
	SCREAMING_SNAKE_CASE_					:      Any        =  {
	    'hidden_size': 'n_embd',
	    'max_position_embeddings': 'n_positions',
	    'num_attention_heads': 'n_head',
	    'num_hidden_layers': 'n_layer',
	}
	def __init__(							self  ,      _lowercase=5_0257  ,      _lowercase=1024  ,      _lowercase=768  ,      _lowercase=12  ,      _lowercase=12  ,      _lowercase=None  ,      _lowercase="gelu_pytorch_tanh"  ,      _lowercase=0.1  ,      _lowercase=0.1  ,      _lowercase=0.1  ,      _lowercase=1E-5  ,      _lowercase=0.02  ,      _lowercase=True  ,      _lowercase=True  ,      _lowercase=5_0256  ,      _lowercase=5_0256  ,      _lowercase=True  ,      _lowercase=True  ,      _lowercase=True  ,      **_lowercase  ,      )						->  Any:
							lowercase_      :   Tuple        =			vocab_size
							lowercase_      :   str        =			n_positions
							lowercase_      :   List[str]        =			n_embd
							lowercase_      :   str        =			n_layer
							lowercase_      :   Optional[Any]        =			n_head
							lowercase_      :   Optional[int]        =			n_inner
							lowercase_      :   Union[str, Any]        =			activation_function
							lowercase_      :   Dict        =			resid_pdrop
							lowercase_      :   str        =			embd_pdrop
							lowercase_      :   Optional[Any]        =			attn_pdrop
							lowercase_      :   List[Any]        =			layer_norm_epsilon
							lowercase_      :   Optional[int]        =			initializer_range
							lowercase_      :   List[Any]        =			scale_attn_weights
							lowercase_      :   Any        =			use_cache
							lowercase_      :   List[str]        =			attention_softmax_in_fpaa
							lowercase_      :   Any        =			scale_attention_softmax_in_fpaa
							lowercase_      :   Optional[Any]        =			multi_query

							lowercase_      :   Optional[Any]        =			bos_token_id
							lowercase_      :   Optional[Any]        =			eos_token_id

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