






import os

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


__A          = logging.get_logger(__name__)





class   SCREAMING_SNAKE_CASE (       lowercase_    ):





							"""simple docstring"""

							def __init__(     self:      Optional[Any]						,   __A:      Optional[Any]						,   __A:      List[Any]=None      )			-> Dict:
												_A									=       language
												_A									=       train_language

							def 					__A       (     self:      List[str]						,   __A:      int      )			-> List[Any]:
												_A									=       self.language if self.train_language is None else self.train_language
												_A									=       self._read_tsv(os.path.join(_lowercase						,   f"""XNLI-MT-1.0/multinli/multinli.train.{lg}.tsv"""      )      )
												_A									=       []
												for i, line in enumerate(_lowercase      ):
																	if i == 0:
																						continue
																	_A									=       f"""train-{i}"""
																	_A									=       line[0]
																	_A									=       line[1]
																	_A									=       '''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 					__A       (     self:      Tuple						,   __A:      Optional[Any]      )			-> List[str]:
												_A									=       self._read_tsv(os.path.join(_lowercase						,   '''XNLI-1.0/xnli.test.tsv'''      )      )
												_A									=       []
												for i, line in enumerate(_lowercase      ):
																	if i == 0:
																						continue
																	_A									=       line[0]
																	if language != self.language:
																						continue
																	_A									=       f"""test-{i}"""
																	_A									=       line[6]
																	_A									=       line[7]
																	_A									=       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 					__A       (     self:      Tuple      )			-> Tuple:
												return ["contradiction", "entailment", "neutral"]



__A          = {
    'xnli': XnliProcessor,
}

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

__A          = {
    'xnli': 3,
}










from typing import TYPE_CHECKING

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


_snake_case				= {"""configuration_bit""": ["""BIT_PRETRAINED_CONFIG_ARCHIVE_MAP""", """BitConfig""", """BitOnnxConfig"""]}

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  _snake_case				= [
      """BIT_PRETRAINED_MODEL_ARCHIVE_LIST""",
      """BitForImageClassification""",
      """BitModel""",
      """BitPreTrainedModel""",
      """BitBackbone""",
  ]


try:
  if not is_vision_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  _snake_case				= ["""BitImageProcessor"""]


if TYPE_CHECKING:
  from .configuration_bit import BIT_PRETRAINED_CONFIG_ARCHIVE_MAP, BitConfig, BitOnnxConfig

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_bit import (
        BIT_PRETRAINED_MODEL_ARCHIVE_LIST,
        BitBackbone,
        BitForImageClassification,
        BitModel,
        BitPreTrainedModel,
    )

  try:
    if not is_vision_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .image_processing_bit import BitImageProcessor

else:
  import sys

  _snake_case				= _LazyModule(__name__, globals()["""__file__"""], _import_structure)






