




'''simple docstring'''




from typing import List

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


a_ :						Optional[Any]				 =			logging.get_logger(__name__)

a_ :						int				 =			{
    """snap-research/efficientformer-l1-300""": (
        """https://huggingface.co/snap-research/efficientformer-l1-300/resolve/main/config.json"""
    ),
}


class     __UpperCamelCase			(					_UpperCamelCase							):
       lowercase      :       Union[str, Any] 		="efficientformer"






       def __init__(				self,						lowerCAmelCase = [3, 2, 6, 4],						lowerCAmelCase = [48, 96, 224, 448],						lowerCAmelCase = [True, True, True, True],						lowerCAmelCase = 448,						lowerCAmelCase = 32,						lowerCAmelCase = 4,						lowerCAmelCase = 7,						lowerCAmelCase = 5,						lowerCAmelCase = 8,						lowerCAmelCase = 4,						lowerCAmelCase = 0.0,						lowerCAmelCase = 16,						lowerCAmelCase = 3,						lowerCAmelCase = 3,						lowerCAmelCase = 3,						lowerCAmelCase = 2,						lowerCAmelCase = 1,						lowerCAmelCase = 0.0,						lowerCAmelCase = 1,						lowerCAmelCase = True,						lowerCAmelCase = True,						lowerCAmelCase = 1e-5,						lowerCAmelCase = "gelu",						lowerCAmelCase = 0.0_2,						lowerCAmelCase = 1e-12,						lowerCAmelCase = 224,						lowerCAmelCase = 1e-05,						**lowerCAmelCase,						):



              """simple docstring"""







              super().__init__(**a_    )

              lowerCamelCase_				=hidden_act
              lowerCamelCase_				=hidden_dropout_prob
              lowerCamelCase_				=hidden_sizes
              lowerCamelCase_				=num_hidden_layers
              lowerCamelCase_				=num_attention_heads
              lowerCamelCase_				=initializer_range
              lowerCamelCase_				=layer_norm_eps
              lowerCamelCase_				=patch_size
              lowerCamelCase_				=num_channels
              lowerCamelCase_				=depths
              lowerCamelCase_				=mlp_expansion_ratio
              lowerCamelCase_				=downsamples
              lowerCamelCase_				=dim
              lowerCamelCase_				=key_dim
              lowerCamelCase_				=attention_ratio
              lowerCamelCase_				=resolution
              lowerCamelCase_				=pool_size
              lowerCamelCase_				=downsample_patch_size
              lowerCamelCase_				=downsample_stride
              lowerCamelCase_				=downsample_pad
              lowerCamelCase_				=drop_path_rate
              lowerCamelCase_				=num_metaad_blocks
              lowerCamelCase_				=distillation
              lowerCamelCase_				=use_layer_scale
              lowerCamelCase_				=layer_scale_init_value
              lowerCamelCase_				=image_size
              lowerCamelCase_				=batch_norm_eps











"""simple docstring"""






import unittest

from transformers import load_tool

from .test_tools_common import ToolTesterMixin



class 					__UpperCAmelCase							(						unittest.TestCase						,  _UpperCamelCase  ):
				def       UpperCAmelCase      (		self    :			Dict    )	->	List[Any]:



							'''simple docstring'''



							a__  :	Any		 =			load_tool("text-classification"    )
							self.tool.setup()
							a__  :	List[Any]		 =			load_tool("text-classification"	, remote=a_    )
				def       UpperCAmelCase      (		self    :			Optional[int]    )	->	Optional[Any]:



							'''simple docstring'''



							a__  :	str		 =			self.tool("That's quite cool"	, ["positive", "negative"]    )
							self.assertEqual(a_	, "positive"    )
				def       UpperCAmelCase      (		self    :			Union[str, Any]    )	->	Optional[int]:



							'''simple docstring'''



							a__  :	List[str]		 =			self.remote_tool("That's quite cool"	, ["positive", "negative"]    )
							self.assertEqual(a_	, "positive"    )
				def       UpperCAmelCase      (		self    :			Dict    )	->	Any:



							'''simple docstring'''



							a__  :	List[str]		 =			self.tool(text="That's quite cool"	, labels=["positive", "negative"]    )
							self.assertEqual(a_	, "positive"    )






				def       UpperCAmelCase      (		self    :			List[Any]    )	->	List[Any]:



							'''simple docstring'''



							a__  :	Tuple		 =			self.remote_tool(text="That's quite cool"	, labels=["positive", "negative"]    )
							self.assertEqual(a_	, "positive"    )