

'''simple docstring'''





import copy

from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ..auto.configuration_auto import CONFIG_MAPPING


_SCREAMING_SNAKE_CASE  :						str         =    logging.get_logger(__name__)






class  UpperCAmelCase__	( A__ ):






  """simple docstring"""


  a     =      "upernet"






  def __init__(							self		:	Optional[Any]			,     __lowerCamelCase		:	str=None			,     __lowerCamelCase		:	str=512			,     __lowerCamelCase		:	int=0.02			,     __lowerCamelCase		:	Optional[Any]=[1, 2, 3, 6]			,     __lowerCamelCase		:	Tuple=True			,     __lowerCamelCase		:	Optional[Any]=0.4			,     __lowerCamelCase		:	List[str]=384			,     __lowerCamelCase		:	Union[str, Any]=256			,     __lowerCamelCase		:	List[Any]=1			,     __lowerCamelCase		:	List[Any]=False			,     __lowerCamelCase		:	List[str]=255			,     **__lowerCamelCase		:	int			,     )	->							List[Any]:
       super().__init__(**__lowerCamelCase      )

       if backbone_config is None:
            logger.info('''`backbone_config` is `None`. Initializing the config with the default `ResNet` backbone.'''      )
            SCREAMING_SNAKE_CASE__					=					CONFIG_MAPPING['''resnet'''](out_features=['''stage1''', '''stage2''', '''stage3''', '''stage4''']      )
       elif isinstance(__lowerCamelCase			,     __lowerCamelCase      ):
            SCREAMING_SNAKE_CASE__					=					backbone_config.get('''model_type'''      )
            SCREAMING_SNAKE_CASE__					=					CONFIG_MAPPING[backbone_model_type]
            SCREAMING_SNAKE_CASE__					=					config_class.from_dict(__lowerCamelCase      )

       SCREAMING_SNAKE_CASE__					=					backbone_config
       SCREAMING_SNAKE_CASE__					=					hidden_size
       SCREAMING_SNAKE_CASE__					=					initializer_range
       SCREAMING_SNAKE_CASE__					=					pool_scales
       SCREAMING_SNAKE_CASE__					=					use_auxiliary_head
       SCREAMING_SNAKE_CASE__					=					auxiliary_loss_weight
       SCREAMING_SNAKE_CASE__					=					auxiliary_in_channels
       SCREAMING_SNAKE_CASE__					=					auxiliary_channels
       SCREAMING_SNAKE_CASE__					=					auxiliary_num_convs
       SCREAMING_SNAKE_CASE__					=					auxiliary_concat_input
       SCREAMING_SNAKE_CASE__					=					loss_ignore_index







  def    lowercase_	(							self		:	List[str]      )	->							int:
       SCREAMING_SNAKE_CASE__					=					copy.deepcopy(self.__dict__      )
       SCREAMING_SNAKE_CASE__					=					self.backbone_config.to_dict()
       SCREAMING_SNAKE_CASE__					=					self.__class__.model_type
       return output





from dataclasses import dataclass, field
from typing import ClassVar, Dict

from ..features import Features, Sequence, Value
from .base import TaskTemplate






@dataclass(frozen=A__ )
class  UpperCAmelCase__	( A__ ):






  """simple docstring"""


  a     =      field(default="question-answering-extractive"		,  metadata={"include_in_asdict_even_if_is_default": True} )
  a     =      Features({"question": Value("string" ), "context": Value("string" )} )
  a     =      Features(
      {
          "answers": Sequence(
              {
                  "text": Value("string" ),
                  "answer_start": Value("int32" ),
              } )
      } )
  a     =      "question"
  a     =      "context"
  a     =      "answers"






  @property
  def    lowercase_	(							self		:	Dict      )	->							Dict[str, str]:
       return {self.question_column: "question", self.context_column: "context", self.answers_column: "answers"}


