



from typing import TYPE_CHECKING

from ..utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_torch_available,
)


UpperCAmelCase							=       {
    'agents': ['Agent', 'AzureOpenAiAgent', 'HfAgent', 'LocalAgent', 'OpenAiAgent'],
    'base': ['PipelineTool', 'RemoteTool', 'Tool', 'launch_gradio_demo', 'load_tool'],
}

try:
	if not is_torch_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	UpperCAmelCase							=       ['DocumentQuestionAnsweringTool']
	UpperCAmelCase							=       ['ImageCaptioningTool']
	UpperCAmelCase							=       ['ImageQuestionAnsweringTool']
	UpperCAmelCase							=       ['ImageSegmentationTool']
	UpperCAmelCase							=       ['SpeechToTextTool']
	UpperCAmelCase							=       ['TextClassificationTool']
	UpperCAmelCase							=       ['TextQuestionAnsweringTool']
	UpperCAmelCase							=       ['TextSummarizationTool']
	UpperCAmelCase							=       ['TextToSpeechTool']
	UpperCAmelCase							=       ['TranslationTool']

if TYPE_CHECKING:
	from .agents import Agent, AzureOpenAiAgent, HfAgent, LocalAgent, OpenAiAgent
	from .base import PipelineTool, RemoteTool, Tool, launch_gradio_demo, load_tool

	try:
		if not is_torch_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .document_question_answering import DocumentQuestionAnsweringTool
		from .image_captioning import ImageCaptioningTool
		from .image_question_answering import ImageQuestionAnsweringTool
		from .image_segmentation import ImageSegmentationTool
		from .speech_to_text import SpeechToTextTool
		from .text_classification import TextClassificationTool
		from .text_question_answering import TextQuestionAnsweringTool
		from .text_summarization import TextSummarizationTool
		from .text_to_speech import TextToSpeechTool
		from .translation import TranslationTool
else:
	import sys

	UpperCAmelCase							=       _LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)









"""simple docstring"""


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


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

_UpperCamelCase							:       int       					=		{
    'apple/mobilevitv2-1.0': 'https://huggingface.co/apple/mobilevitv2-1.0/resolve/main/config.json',
}






class 		snake_case    (    UpperCAmelCase			):
    __magic_name__       	=	'''mobilevitv2'''





    def __init__(				self      :   Any							,						A      :   Any=3							,						A      :   Any=2_5_6							,						A      :   Optional[int]=2							,						A      :   str=2.0							,						A      :   Union[str, Any]="swish"							,						A      :   str=3							,						A      :   Tuple=3_2							,						A      :   Optional[int]=0.1							,						A      :   str=0.02							,						A      :   int=1E-5							,						A      :   List[Any]=5_1_2							,						A      :   str=[6, 1_2, 1_8]							,						A      :   Any=0.1							,						A      :   Union[str, Any]=2_5_5							,						A      :   Optional[Any]=[2, 4, 3]							,						A      :   List[Any]=[1_2_8, 1_9_2, 2_5_6]							,						A      :   Tuple=1.0							,						A      :   Union[str, Any]=2							,						A      :   List[Any]=0.0							,						A      :   int=0.0							,						**A      :   Optional[Any]							,						):


      '''simple docstring'''




      super().__init__(**A     )

      a	:     Optional[Any]							=  num_channels
      a	:     List[Any]							=  image_size
      a	:     Tuple							=  patch_size
      a	:     Optional[Any]							=  expand_ratio
      a	:     Any							=  hidden_act
      a	:     Dict							=  conv_kernel_size
      a	:     Optional[int]							=  output_stride
      a	:     Optional[Any]							=  initializer_range
      a	:     Tuple							=  layer_norm_eps
      a	:     Optional[int]							=  n_attn_blocks
      a	:     Tuple							=  base_attn_unit_dims
      a	:     List[str]							=  width_multiplier
      a	:     Dict							=  ffn_multiplier
      a	:     Dict							=  ffn_dropout
      a	:     Optional[int]							=  attn_dropout
      a	:     Tuple							=  classifier_dropout_prob

      # decode head attributes for semantic segmentation
      a	:     str							=  aspp_out_channels
      a	:     List[Any]							=  atrous_rates
      a	:     Optional[int]							=  aspp_dropout_prob
      a	:     Optional[Any]							=  semantic_loss_ignore_index






class 		snake_case    (    UpperCAmelCase			):
    __magic_name__       	=	version.parse('''1.11'''			)





    @property
    def 							lowerCamelCase__ (				self      :   List[str]     ):


      '''simple docstring'''




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





    @property
    def 							lowerCamelCase__ (				self      :   int     ):


      '''simple docstring'''




      if self.task == "image-classification":
        return OrderedDict([('logits', {0: 'batch'})]     )
      else:
        return OrderedDict([('last_hidden_state', {0: 'batch'}), ('pooler_output', {0: 'batch'})]     )





    @property
    def 							lowerCamelCase__ (				self      :   Union[str, Any]     ):


      '''simple docstring'''




      return 1E-4




