

'''simple docstring'''

import os

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


UpperCAmelCase							=					logging.get_logger(__name__)


class 					lowerCAmelCase							( A				):







       def __init__(							self     :	Optional[int]  , __lowercase     :	int  , __lowercase     :	List[str]=None ):







            """simple docstring"""







            __lowercase     						=language
            __lowercase     						=train_language







       def      snake_case				(							self     :	List[str]  , __lowercase     :	List[str] ):







            """simple docstring"""







            __lowercase     						=self.language if self.train_language is None else self.train_language
            __lowercase     						=self._read_tsv(os.path.join(__lowercase  , f'''XNLI-MT-1.0/multinli/multinli.train.{lg}.tsv''' ) )
            __lowercase     						=[]
            for i, line in enumerate(__lowercase ):
                 if i == 0:
                      continue
                 __lowercase     						=f'''train-{i}'''
                 __lowercase     						=line[0]
                 __lowercase     						=line[1]
                 __lowercase     						='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      snake_case				(							self     :	str  , __lowercase     :	Optional[int] ):







            """simple docstring"""







            __lowercase     						=self._read_tsv(os.path.join(__lowercase  , 'XNLI-1.0/xnli.test.tsv' ) )
            __lowercase     						=[]
            for i, line in enumerate(__lowercase ):
                 if i == 0:
                      continue
                 __lowercase     						=line[0]
                 if language != self.language:
                      continue
                 __lowercase     						=f'''test-{i}'''
                 __lowercase     						=line[6]
                 __lowercase     						=line[7]
                 __lowercase     						=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      snake_case				(							self     :	Optional[int] ):







            """simple docstring"""







            return ["contradiction", "entailment", "neutral"]






UpperCAmelCase							=					{
    '''xnli''': XnliProcessor,
}

UpperCAmelCase							=					{
    '''xnli''': '''classification''',
}

UpperCAmelCase							=					{
    '''xnli''': 3,
}





'''simple docstring'''

from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available


UpperCAmelCase							=					{
    '''configuration_videomae''': ['''VIDEOMAE_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''VideoMAEConfig'''],
}

try:
       if not is_torch_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       UpperCAmelCase							=					[
           '''VIDEOMAE_PRETRAINED_MODEL_ARCHIVE_LIST''',
           '''VideoMAEForPreTraining''',
           '''VideoMAEModel''',
           '''VideoMAEPreTrainedModel''',
           '''VideoMAEForVideoClassification''',
       ]

try:
       if not is_vision_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       UpperCAmelCase							=					['''VideoMAEFeatureExtractor''']
       UpperCAmelCase							=					['''VideoMAEImageProcessor''']

if TYPE_CHECKING:
       from .configuration_videomae import VIDEOMAE_PRETRAINED_CONFIG_ARCHIVE_MAP, VideoMAEConfig

       try:
              if not is_torch_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .modeling_videomae import (
                  VIDEOMAE_PRETRAINED_MODEL_ARCHIVE_LIST,
                  VideoMAEForPreTraining,
                  VideoMAEForVideoClassification,
                  VideoMAEModel,
                  VideoMAEPreTrainedModel,
              )

       try:
              if not is_vision_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .feature_extraction_videomae import VideoMAEFeatureExtractor
              from .image_processing_videomae import VideoMAEImageProcessor

else:
       import sys

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


