


"""simple docstring"""





import os

from ...utils import logging
from .utils import DataProcessor, InputExample


__UpperCAmelCase    				=      logging.get_logger(__name__)

class  lowercase_  ( a_						):







      def __init__(      self :							Optional[int]		,  _lowercase :							Any		,  _lowercase :							Optional[Any]=None    ):
        lowerCAmelCase__    :    Union[str, Any]								=					language
        lowerCAmelCase__    :    Dict								=					train_language







      def 				_lowerCAmelCase       (      self :							int		,  _lowercase :							Union[str, Any]    ):
        lowerCAmelCase__    :    Dict								=					self.language if self.train_language is None else self.train_language
        lowerCAmelCase__    :    int								=					self._read_tsv(os.path.join(_lowercase		,  f"XNLI-MT-1.0/multinli/multinli.train.{lg}.tsv"    )    )
        lowerCAmelCase__    :    Dict								=					[]
        for i, line in enumerate(_lowercase    ):
          if i == 0:
            continue
          lowerCAmelCase__    :    Optional[Any]								=					f"train-{i}"
          lowerCAmelCase__    :    int								=					line[0]
          lowerCAmelCase__    :    str								=					line[1]
          lowerCAmelCase__    :    Optional[int]								=					"contradiction" if line[2] == "contradictory" else line[2]
          if not isinstance(_lowercase		,  _lowercase    ):
            raise ValueError(f"Training input {text_a} is not a string"    )
          if not isinstance(_lowercase		,  _lowercase    ):
            raise ValueError(f"Training input {text_b} is not a string"    )
          if not isinstance(_lowercase		,  _lowercase    ):
            raise ValueError(f"Training label {label} is not a string"    )
          examples.append(InputExample(guid=_lowercase		,  text_a=_lowercase		,  text_b=_lowercase		,  label=_lowercase    )    )
        return examples







      def 				_lowerCAmelCase       (      self :							Optional[int]		,  _lowercase :							Optional[int]    ):
        lowerCAmelCase__    :    int								=					self._read_tsv(os.path.join(_lowercase		,  "XNLI-1.0/xnli.test.tsv"    )    )
        lowerCAmelCase__    :    Union[str, Any]								=					[]
        for i, line in enumerate(_lowercase    ):
          if i == 0:
            continue
          lowerCAmelCase__    :    Tuple								=					line[0]
          if language != self.language:
            continue
          lowerCAmelCase__    :    Union[str, Any]								=					f"test-{i}"
          lowerCAmelCase__    :    Tuple								=					line[6]
          lowerCAmelCase__    :    Dict								=					line[7]
          lowerCAmelCase__    :    List[Any]								=					line[1]
          if not isinstance(_lowercase		,  _lowercase    ):
            raise ValueError(f"Training input {text_a} is not a string"    )
          if not isinstance(_lowercase		,  _lowercase    ):
            raise ValueError(f"Training input {text_b} is not a string"    )
          if not isinstance(_lowercase		,  _lowercase    ):
            raise ValueError(f"Training label {label} is not a string"    )
          examples.append(InputExample(guid=_lowercase		,  text_a=_lowercase		,  text_b=_lowercase		,  label=_lowercase    )    )
        return examples







      def 				_lowerCAmelCase       (      self :							Optional[Any]    ):
        return ["contradiction", "entailment", "neutral"]
__UpperCAmelCase    				=      {
    "xnli": XnliProcessor,
}

__UpperCAmelCase    				=      {
    "xnli": "classification",
}

__UpperCAmelCase    				=      {
    "xnli": 3,
}




"""simple docstring"""





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


__UpperCAmelCase    				=      logging.get_logger(__name__)

__UpperCAmelCase    				=      {
    "MCG-NJU/videomae-base": "https://huggingface.co/MCG-NJU/videomae-base/resolve/main/config.json",
}

class  lowercase_  ( a_						):
      __magic_name__     :							Union[str, Any]          =				"""videomae"""







      def __init__(      self :							Dict		,  _lowercase :							int=2_2_4		,  _lowercase :							Optional[Any]=1_6		,  _lowercase :							List[Any]=3		,  _lowercase :							int=1_6		,  _lowercase :							Optional[Any]=2		,  _lowercase :							Union[str, Any]=7_6_8		,  _lowercase :							int=1_2		,  _lowercase :							Dict=1_2		,  _lowercase :							Optional[Any]=3_0_7_2		,  _lowercase :							List[str]="gelu"		,  _lowercase :							int=0.0		,  _lowercase :							int=0.0		,  _lowercase :							Optional[int]=0.02		,  _lowercase :							List[str]=1e-1_2		,  _lowercase :							Union[str, Any]=True		,  _lowercase :							Union[str, Any]=True		,  _lowercase :							Any=6		,  _lowercase :							Any=3_8_4		,  _lowercase :							int=4		,  _lowercase :							Optional[int]=1_5_3_6		,  _lowercase :							Tuple=True		,  **_lowercase :							List[str]		,  ):
        super().__init__(**_lowercase    )

        lowerCAmelCase__    :    List[Any]								=					image_size
        lowerCAmelCase__    :    Tuple								=					patch_size
        lowerCAmelCase__    :    Union[str, Any]								=					num_channels
        lowerCAmelCase__    :    Optional[Any]								=					num_frames
        lowerCAmelCase__    :    Union[str, Any]								=					tubelet_size

        lowerCAmelCase__    :    Union[str, Any]								=					hidden_size
        lowerCAmelCase__    :    Dict								=					num_hidden_layers
        lowerCAmelCase__    :    Any								=					num_attention_heads
        lowerCAmelCase__    :    List[Any]								=					intermediate_size
        lowerCAmelCase__    :    Optional[Any]								=					hidden_act
        lowerCAmelCase__    :    int								=					hidden_dropout_prob
        lowerCAmelCase__    :    Optional[Any]								=					attention_probs_dropout_prob
        lowerCAmelCase__    :    Any								=					initializer_range
        lowerCAmelCase__    :    Any								=					layer_norm_eps
        lowerCAmelCase__    :    Union[str, Any]								=					qkv_bias
        lowerCAmelCase__    :    int								=					use_mean_pooling

        lowerCAmelCase__    :    List[Any]								=					decoder_num_attention_heads
        lowerCAmelCase__    :    List[str]								=					decoder_hidden_size
        lowerCAmelCase__    :    int								=					decoder_num_hidden_layers
        lowerCAmelCase__    :    Optional[int]								=					decoder_intermediate_size
        lowerCAmelCase__    :    Optional[Any]								=					norm_pix_loss
