



import os

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


UpperCAmelCase				:							Dict								=logging.get_logger(__name__)


class  _lowercase				(a_ ):
				'''simple docstring'''







				def __init__(	self       ,	snake_case__       ,	snake_case__=None      ):

									'''simple docstring'''


									UpperCamelCase_											=				language
									UpperCamelCase_											=				train_language

				def  _lowerCamelCase   (	self       ,	snake_case__      ):

									'''simple docstring'''


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

				def  _lowerCamelCase   (	self       ,	snake_case__      ):

									'''simple docstring'''


									UpperCamelCase_											=				self._read_tsv(os.path.join(snake_case__       ,	"XNLI-1.0/xnli.test.tsv"      )      )
									UpperCamelCase_											=				[]
									for i, line in enumerate(snake_case__      ):
														if i == 0:
																			continue
														UpperCamelCase_											=				line[0]
														if language != self.language:
																			continue
														UpperCamelCase_											=				F"""test-{i}"""
														UpperCamelCase_											=				line[6]
														UpperCamelCase_											=				line[7]
														UpperCamelCase_											=				line[1]
														if not isinstance(snake_case__       ,	snake_case__      ):
																			raise ValueError(F"""Training input {text_a} is not a string"""      )
														if not isinstance(snake_case__       ,	snake_case__      ):
																			raise ValueError(F"""Training input {text_b} is not a string"""      )
														if not isinstance(snake_case__       ,	snake_case__      ):
																			raise ValueError(F"""Training label {label} is not a string"""      )
														examples.append(InputExample(guid=snake_case__       ,	text_a=snake_case__       ,	text_b=snake_case__       ,	label=snake_case__      )      )
									return examples

				def  _lowerCamelCase   (	self      ):

									'''simple docstring'''


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




UpperCAmelCase				:							Tuple								={
    """xnli""": XnliProcessor,
}

UpperCAmelCase				:							Tuple								={
    """xnli""": """classification""",
}

UpperCAmelCase				:							List[Any]								={
    """xnli""": 3,
}





from ...utils import is_transformers_available
from .pipeline_latent_diffusion_superresolution import LDMSuperResolutionPipeline


if is_transformers_available():
	from .pipeline_latent_diffusion import LDMBertModel, LDMTextToImagePipeline
