


"""simple docstring"""






from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices


__snake_case				=				logging.get_logger(__name__)

__snake_case				=				{
    '''microsoft/focalnet-tiny''': '''https://huggingface.co/microsoft/focalnet-tiny/resolve/main/config.json''',
}


class 			__lowerCamelCase     (    _A     ,    _A ):

     '''simple docstring'''
     A_				:		str			=						"focalnet"


     def __init__(					self			, __UpperCAmelCase=224			, __UpperCAmelCase=4			, __UpperCAmelCase=3			, __UpperCAmelCase=96			, __UpperCAmelCase=False			, __UpperCAmelCase=[192, 384, 768, 768]			, __UpperCAmelCase=[2, 2, 6, 2]			, __UpperCAmelCase=[2, 2, 2, 2]			, __UpperCAmelCase=[3, 3, 3, 3]			, __UpperCAmelCase="gelu"			, __UpperCAmelCase=4.0			, __UpperCAmelCase=0.0			, __UpperCAmelCase=0.1			, __UpperCAmelCase=False			, __UpperCAmelCase=1e-4			, __UpperCAmelCase=False			, __UpperCAmelCase=False			, __UpperCAmelCase=False			, __UpperCAmelCase=0.02			, __UpperCAmelCase=1e-5			, __UpperCAmelCase=32			, __UpperCAmelCase=None			, __UpperCAmelCase=None			, **__UpperCAmelCase			, )				->							Union[str, Any]:
          super().__init__(**__UpperCAmelCase							)

          _a					= image_size
          _a					= patch_size
          _a					= num_channels
          _a					= embed_dim
          _a					= use_conv_embed
          _a					= hidden_sizes
          _a					= depths
          _a					= focal_levels
          _a					= focal_windows
          _a					= hidden_act
          _a					= mlp_ratio
          _a					= hidden_dropout_prob
          _a					= drop_path_rate
          _a					= use_layerscale
          _a					= layerscale_value
          _a					= use_post_layernorm
          _a					= use_post_layernorm_in_modulation
          _a					= normalize_modulator
          _a					= initializer_range
          _a					= layer_norm_eps
          _a					= encoder_stride
          _a					= ['''stem'''] + [F'stage{idx}' for idx in range(1			, len(self.depths							) + 1							)]
          _a					= get_aligned_output_features_output_indices(
              out_features=__UpperCAmelCase			, out_indices=__UpperCAmelCase			, stage_names=self.stage_names							)







"""simple docstring"""



import unittest

from transformers import load_tool

from .test_tools_common import ToolTesterMixin


__A		:       Dict  				=		'''
Hugging Face was founded in 2016 by French entrepreneurs Clément Delangue, Julien Chaumond, and Thomas Wolf originally as a company that developed a chatbot app targeted at teenagers.[2] After open-sourcing the model behind the chatbot, the company pivoted to focus on being a platform for machine learning.

In March 2021, Hugging Face raised $40 million in a Series B funding round.[3]

On April 28, 2021, the company launched the BigScience Research Workshop in collaboration with several other research groups to release an open large language model.[4] In 2022, the workshop concluded with the announcement of BLOOM, a multilingual large language model with 176 billion parameters.[5]
'''





class 					_UpperCAmelCase       ( unittest.TestCase   ,						_A							):




					def   A  (				self     :						List[Any]   )  ->  Dict:
							lowercase_ : Optional[int]							       =   load_tool('''text-question-answering'''   )
							self.tool.setup()
							lowercase_ : Union[str, Any]							       =   load_tool('''text-question-answering'''    ,						remote=A   )




					def   A  (				self     :						Any   )  ->  List[str]:
							lowercase_ : Union[str, Any]							       =   self.tool(A    ,						'''What did Hugging Face do in April 2021?'''   )
							self.assertEqual(A    ,						'''launched the BigScience Research Workshop'''   )




					def   A  (				self     :						str   )  ->  List[str]:
							lowercase_ : int							       =   self.remote_tool(A    ,						'''What did Hugging Face do in April 2021?'''   )
							self.assertEqual(A    ,						'''launched the BigScience Research Workshop'''   )




					def   A  (				self     :						List[Any]   )  ->  int:
							lowercase_ : Optional[Any]							       =   self.tool(text=A    ,						question='''What did Hugging Face do in April 2021?'''   )
							self.assertEqual(A    ,						'''launched the BigScience Research Workshop'''   )






					def   A  (				self     :						List[str]   )  ->  Optional[int]:
							lowercase_ : int							       =   self.remote_tool(text=A    ,						question='''What did Hugging Face do in April 2021?'''   )
							self.assertEqual(A    ,						'''launched the BigScience Research Workshop'''   )



