





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


UpperCAmelCase__  :     Optional[int]   			=logging.get_logger(__name__)

UpperCAmelCase__  :     Tuple   			={'''openai-gpt''': '''https://huggingface.co/openai-gpt/resolve/main/config.json'''}

class  __A       (  a      ):
    __A								=			"""openai-gpt"""
    __A								=			{
        """max_position_embeddings""": """n_positions""",
        """hidden_size""": """n_embd""",
        """num_attention_heads""": """n_head""",
        """num_hidden_layers""": """n_layer""",
    }


    def __init__(						self				,	UpperCAmelCase_=40478				,	UpperCAmelCase_=512				,	UpperCAmelCase_=768				,	UpperCAmelCase_=12				,	UpperCAmelCase_=12				,	UpperCAmelCase_="gelu"				,	UpperCAmelCase_=0.1				,	UpperCAmelCase_=0.1				,	UpperCAmelCase_=0.1				,	UpperCAmelCase_=1E-5				,	UpperCAmelCase_=0.0_2				,	UpperCAmelCase_="cls_index"				,	UpperCAmelCase_=True				,	UpperCAmelCase_=None				,	UpperCAmelCase_=True				,	UpperCAmelCase_=0.1				,	**UpperCAmelCase_				,	):
        lowerCamelCase			=vocab_size
        lowerCamelCase			=n_positions
        lowerCamelCase			=n_embd
        lowerCamelCase			=n_layer
        lowerCamelCase			=n_head
        lowerCamelCase			=afn
        lowerCamelCase			=resid_pdrop
        lowerCamelCase			=embd_pdrop
        lowerCamelCase			=attn_pdrop
        lowerCamelCase			=layer_norm_epsilon
        lowerCamelCase			=initializer_range
        lowerCamelCase			=summary_type
        lowerCamelCase			=summary_use_proj
        lowerCamelCase			=summary_activation
        lowerCamelCase			=summary_first_dropout
        lowerCamelCase			=summary_proj_to_labels
        super().__init__(**UpperCAmelCase_							)












import pytest
import requests

from datasets.utils.file_utils import http_head

from .utils import OfflineSimulationMode, RequestWouldHangIndefinitelyError, offline





@pytest.mark.integration
def        _lowercase   (  )  ->					str:
				with offline(OfflineSimulationMode.CONNECTION_TIMES_OUT			):
								with pytest.raises(_UpperCAmelCase			):
												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        _lowercase   (  )  ->					Union[str, Any]:
				with offline(OfflineSimulationMode.CONNECTION_FAILS			):
								with pytest.raises(requests.exceptions.ConnectionError			):
												requests.request("""GET"""     , """https://huggingface.co"""			)





def        _lowercase   (  )  ->					int:
				with offline(OfflineSimulationMode.HF_DATASETS_OFFLINE_SET_TO_1			):
								with pytest.raises(_UpperCAmelCase			):
												http_head("""https://huggingface.co"""			)





