





import os

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


_lowerCamelCase       =	logging.get_logger(__name__)




class      UpperCamelCase_				(   UpperCamelCase__			):


							def __init__(							self			:Tuple							, __A			:List[Any]							, __A			:str=None						)      ->      Dict:



									"""simple docstring"""



									SCREAMING_SNAKE_CASE__								=					language
									SCREAMING_SNAKE_CASE__								=					train_language


							def    _snake_case     (							self			:Tuple							, __A			:Optional[int]						)      ->      Any:



									"""simple docstring"""



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



									"""simple docstring"""



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



									"""simple docstring"""



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



_lowerCamelCase       =	{
    'xnli': XnliProcessor,
}

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

_lowerCamelCase       =	{
    'xnli': 3,
}





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


lowercase_		=							logging.get_logger(__name__)

lowercase_		=							{
    '''uw-madison/yoso-4096''': '''https://huggingface.co/uw-madison/yoso-4096/resolve/main/config.json''',
    # See all YOSO models at https://huggingface.co/models?filter=yoso
}





class 		A__				(   __SCREAMING_SNAKE_CASE ):
	lowerCamelCase__		: Tuple				    ="yoso"






	def __init__(	self				,     lowerCamelCase=50265				,     lowerCamelCase=768				,     lowerCamelCase=12				,     lowerCamelCase=12				,     lowerCamelCase=3072				,     lowerCamelCase="gelu"				,     lowerCamelCase=0.1				,     lowerCamelCase=0.1				,     lowerCamelCase=4096				,     lowerCamelCase=1				,     lowerCamelCase=0.0_2				,     lowerCamelCase=1e-12				,     lowerCamelCase="absolute"				,     lowerCamelCase=True				,     lowerCamelCase=9				,     lowerCamelCase=64				,     lowerCamelCase=None				,     lowerCamelCase=True				,     lowerCamelCase=True				,     lowerCamelCase=1				,     lowerCamelCase=0				,     lowerCamelCase=2				,     **lowerCamelCase				,     )      ->   Tuple:




						"""simple docstring"""






						super().__init__(pad_token_id=lowerCamelCase				,     bos_token_id=lowerCamelCase				,     eos_token_id=lowerCamelCase				,     **lowerCamelCase						)

						__magic_name__					:							Union[str, Any]		   =							vocab_size
						__magic_name__					:							Union[str, Any]		   =							max_position_embeddings
						__magic_name__					:							Tuple		   =							hidden_size
						__magic_name__					:							Optional[Any]		   =							num_hidden_layers
						__magic_name__					:							Any		   =							num_attention_heads
						__magic_name__					:							List[str]		   =							intermediate_size
						__magic_name__					:							List[str]		   =							hidden_act
						__magic_name__					:							Tuple		   =							hidden_dropout_prob
						__magic_name__					:							str		   =							attention_probs_dropout_prob
						__magic_name__					:							str		   =							initializer_range
						__magic_name__					:							List[str]		   =							type_vocab_size
						__magic_name__					:							Dict		   =							layer_norm_eps
						__magic_name__					:							Any		   =							position_embedding_type
						__magic_name__					:							Optional[Any]		   =							use_expectation
						__magic_name__					:							Optional[Any]		   =							hash_code_len
						__magic_name__					:							Dict		   =							num_hash
						__magic_name__					:							str		   =							conv_window
						__magic_name__					:							Optional[Any]		   =							use_fast_hash
						__magic_name__					:							Union[str, Any]		   =							lsh_backward



