




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


lowerCamelCase__					:  Union[str, Any]      							=				logging.get_logger(__name__)

lowerCamelCase__					:  Optional[int]      							=				{'openai-gpt': 'https://huggingface.co/openai-gpt/resolve/main/config.json'}





class 			lowerCamelCase_				( _SCREAMING_SNAKE_CASE   ):


 '''simple docstring'''







 lowercase_							       =       "openai-gpt"
 lowercase_							       =       {
     "max_position_embeddings": "n_positions",
     "hidden_size": "n_embd",
     "num_attention_heads": "n_head",
     "num_hidden_layers": "n_layer",
 }



 def __init__(				self    :						Optional[int]							,							_lowerCAmelCase    :						Union[str, Any]=40_478							,							_lowerCAmelCase    :						Union[str, Any]=512							,							_lowerCAmelCase    :						int=768							,							_lowerCAmelCase    :						str=12							,							_lowerCAmelCase    :						Optional[int]=12							,							_lowerCAmelCase    :						List[Any]="gelu"							,							_lowerCAmelCase    :						List[str]=0.1							,							_lowerCAmelCase    :						int=0.1							,							_lowerCAmelCase    :						Optional[int]=0.1							,							_lowerCAmelCase    :						Tuple=1E-5							,							_lowerCAmelCase    :						Union[str, Any]=0.02							,							_lowerCAmelCase    :						Any="cls_index"							,							_lowerCAmelCase    :						List[str]=True							,							_lowerCAmelCase    :						Dict=None							,							_lowerCAmelCase    :						List[Any]=True							,							_lowerCAmelCase    :						List[str]=0.1							,							**_lowerCAmelCase    :						Optional[int]							,							):
       SCREAMING_SNAKE_CASE_      		=     vocab_size
       SCREAMING_SNAKE_CASE_      		=     n_positions
       SCREAMING_SNAKE_CASE_      		=     n_embd
       SCREAMING_SNAKE_CASE_      		=     n_layer
       SCREAMING_SNAKE_CASE_      		=     n_head
       SCREAMING_SNAKE_CASE_      		=     afn
       SCREAMING_SNAKE_CASE_      		=     resid_pdrop
       SCREAMING_SNAKE_CASE_      		=     embd_pdrop
       SCREAMING_SNAKE_CASE_      		=     attn_pdrop
       SCREAMING_SNAKE_CASE_      		=     layer_norm_epsilon
       SCREAMING_SNAKE_CASE_      		=     initializer_range
       SCREAMING_SNAKE_CASE_      		=     summary_type
       SCREAMING_SNAKE_CASE_      		=     summary_use_proj
       SCREAMING_SNAKE_CASE_      		=     summary_activation
       SCREAMING_SNAKE_CASE_      		=     summary_first_dropout
       SCREAMING_SNAKE_CASE_      		=     summary_proj_to_labels
       super().__init__(**_lowerCAmelCase		)
'''simple docstring'''






import pytest
import requests

from datasets.utils.file_utils import http_head

from .utils import OfflineSimulationMode, RequestWouldHangIndefinitelyError, offline





@pytest.mark.integration
def  _SCREAMING_SNAKE_CASE		(      ):
     with offline(OfflineSimulationMode.CONNECTION_TIMES_OUT				):
          with pytest.raises(__snake_case				):
               requests.request('GET'   ,		'https://huggingface.co'				)
          with pytest.raises(requests.exceptions.ConnectTimeout				):
               requests.request('GET'   ,		'https://huggingface.co'   ,		timeout=1.0				)





@pytest.mark.integration
def  _SCREAMING_SNAKE_CASE		(      ):
     with offline(OfflineSimulationMode.CONNECTION_FAILS				):
          with pytest.raises(requests.exceptions.ConnectionError				):
               requests.request('GET'   ,		'https://huggingface.co'				)





def  _SCREAMING_SNAKE_CASE		(      ):
     with offline(OfflineSimulationMode.HF_DATASETS_OFFLINE_SET_TO_1				):
          with pytest.raises(__snake_case				):
               http_head('https://huggingface.co'				)



