





from collections import OrderedDict
from typing import Mapping

from packaging import version

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


_A					:				int				=			logging.get_logger(__name__)

_A					:				List[Any]				=			{
    """hustvl/yolos-small""": """https://huggingface.co/hustvl/yolos-small/resolve/main/config.json""",
    # See all YOLOS models at https://huggingface.co/models?filter=yolos
}



class 					__snake_case	(  __SCREAMING_SNAKE_CASE    ):


    '''simple docstring'''







    lowerCamelCase__    :		Optional[Any]				=	"""yolos"""



    def __init__(       self   ,				A_=7_68   ,				A_=12   ,				A_=12   ,				A_=30_72   ,				A_="gelu"   ,				A_=0.0   ,				A_=0.0   ,				A_=0.02   ,				A_=1E-12   ,				A_=[5_12, 8_64]   ,				A_=16   ,				A_=3   ,				A_=True   ,				A_=1_00   ,				A_=True   ,				A_=False   ,				A_=1   ,				A_=5   ,				A_=2   ,				A_=5   ,				A_=2   ,				A_=0.1   ,				**A_   ,				):





        '''simple docstring'''

        super().__init__(**A_     )

        SCREAMING_SNAKE_CASE__											=			hidden_size
        SCREAMING_SNAKE_CASE__											=			num_hidden_layers
        SCREAMING_SNAKE_CASE__											=			num_attention_heads
        SCREAMING_SNAKE_CASE__											=			intermediate_size
        SCREAMING_SNAKE_CASE__											=			hidden_act
        SCREAMING_SNAKE_CASE__											=			hidden_dropout_prob
        SCREAMING_SNAKE_CASE__											=			attention_probs_dropout_prob
        SCREAMING_SNAKE_CASE__											=			initializer_range
        SCREAMING_SNAKE_CASE__											=			layer_norm_eps
        SCREAMING_SNAKE_CASE__											=			image_size
        SCREAMING_SNAKE_CASE__											=			patch_size
        SCREAMING_SNAKE_CASE__											=			num_channels
        SCREAMING_SNAKE_CASE__											=			qkv_bias
        SCREAMING_SNAKE_CASE__											=			num_detection_tokens
        SCREAMING_SNAKE_CASE__											=			use_mid_position_embeddings
        SCREAMING_SNAKE_CASE__											=			auxiliary_loss
        # Hungarian matcher
        SCREAMING_SNAKE_CASE__											=			class_cost
        SCREAMING_SNAKE_CASE__											=			bbox_cost
        SCREAMING_SNAKE_CASE__											=			giou_cost
        # Loss coefficients
        SCREAMING_SNAKE_CASE__											=			bbox_loss_coefficient
        SCREAMING_SNAKE_CASE__											=			giou_loss_coefficient
        SCREAMING_SNAKE_CASE__											=			eos_coefficient





class 					__snake_case	(  __SCREAMING_SNAKE_CASE    ):


    '''simple docstring'''







    lowerCamelCase__    :		Union[str, Any]				=	version.parse("""1.11"""    )



    @property
    def  lowercase_					(       self     ):





        '''simple docstring'''

        return OrderedDict(
            [
                ('''pixel_values''', {0: '''batch''', 1: '''num_channels''', 2: '''height''', 3: '''width'''}),
            ]     )



    @property
    def  lowercase_					(       self     ):





        '''simple docstring'''

        return 1E-4




    @property
    def  lowercase_					(       self     ):





        '''simple docstring'''

        return 12







import pytest
import requests

from datasets.utils.file_utils import http_head

from .utils import OfflineSimulationMode, RequestWouldHangIndefinitelyError, offline


@pytest.mark.integration
def 							__snake_case							(    )				->						Any:
    with offline(OfflineSimulationMode.CONNECTION_TIMES_OUT	):
        with pytest.raises(lowerCAmelCase_	):
            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 							__snake_case							(    )				->						int:
    with offline(OfflineSimulationMode.CONNECTION_FAILS	):
        with pytest.raises(requests.exceptions.ConnectionError	):
            requests.request('''GET''' ,							'''https://huggingface.co'''	)



def 							__snake_case							(    )				->						List[Any]:
    with offline(OfflineSimulationMode.HF_DATASETS_OFFLINE_SET_TO_1	):
        with pytest.raises(lowerCAmelCase_	):
            http_head('''https://huggingface.co'''	)
