"""simple docstring"""







import os

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


_a	:	Union[str, Any]=					logging.get_logger(__name__)

class 						UpperCamelCase     (       lowercase		):



				def __init__(self							: List[str]      ,    _A							: Optional[Any]      ,    _A							: List[Any]=None)       ->      List[str]:
					__snake_case     :				int 						=					language
					__snake_case     :				int 						=					train_language



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



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






				def    _lowercase	(self							: List[str])       ->      Union[str, Any]:
					return ["contradiction", "entailment", "neutral"]







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

_a	:	Optional[Any]=					{
    "xnli": "classification",
}

_a	:	str=					{
    "xnli": 3,
}






"""simple docstring"""







from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_tf_available,
    is_torch_available,
)


_a	:	Optional[Any]=					{"configuration_gptj": ["GPTJ_PRETRAINED_CONFIG_ARCHIVE_MAP", "GPTJConfig", "GPTJOnnxConfig"]}

try:
	if not is_torch_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	_a	:	Dict=					[
	    "GPTJ_PRETRAINED_MODEL_ARCHIVE_LIST",
	    "GPTJForCausalLM",
	    "GPTJForQuestionAnswering",
	    "GPTJForSequenceClassification",
	    "GPTJModel",
	    "GPTJPreTrainedModel",
	]

try:
	if not is_tf_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	_a	:	Optional[Any]=					[
	    "TFGPTJForCausalLM",
	    "TFGPTJForQuestionAnswering",
	    "TFGPTJForSequenceClassification",
	    "TFGPTJModel",
	    "TFGPTJPreTrainedModel",
	]

try:
	if not is_flax_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	_a	:	List[str]=					[
	    "FlaxGPTJForCausalLM",
	    "FlaxGPTJModel",
	    "FlaxGPTJPreTrainedModel",
	]


if TYPE_CHECKING:
	from .configuration_gptj import GPTJ_PRETRAINED_CONFIG_ARCHIVE_MAP, GPTJConfig, GPTJOnnxConfig

	try:
		if not is_torch_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .modeling_gptj import (
		    GPTJ_PRETRAINED_MODEL_ARCHIVE_LIST,
		    GPTJForCausalLM,
		    GPTJForQuestionAnswering,
		    GPTJForSequenceClassification,
		    GPTJModel,
		    GPTJPreTrainedModel,
		)

	try:
		if not is_tf_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .modeling_tf_gptj import (
		    TFGPTJForCausalLM,
		    TFGPTJForQuestionAnswering,
		    TFGPTJForSequenceClassification,
		    TFGPTJModel,
		    TFGPTJPreTrainedModel,
		)

	try:
		if not is_flax_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .modeling_flax_gptj import FlaxGPTJForCausalLM, FlaxGPTJModel, FlaxGPTJPreTrainedModel

else:
	import sys

	_a	:	Any=					_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)





