





"""simple docstring"""




import os

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


UpperCamelCase_	 =logging.get_logger(__name__)




class 					_a		( _lowerCAmelCase							):






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




										'''simple docstring'''



										_UpperCamelCase     :   Optional[int]      =       language
										_UpperCamelCase     :   Dict      =       train_language






				def 							snake_case      (					self						:       Optional[int],					lowerCAmelCase__						:       Any				)      -> int:




										'''simple docstring'''



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






				def 							snake_case      (					self						:       Any,					lowerCAmelCase__						:       int				)      -> str:




										'''simple docstring'''



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






				def 							snake_case      (					self						:       int				)      -> Union[str, Any]:




										'''simple docstring'''



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

UpperCamelCase_	 ={
    """xnli""": XnliProcessor,
}

UpperCamelCase_	 ={
    """xnli""": """classification""",
}

UpperCamelCase_	 ={
    """xnli""": 3,
}





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


_A       =					logging.get_logger(__name__)

_A       =					{
    "openbmb/cpm-ant-10b": "https://huggingface.co/openbmb/cpm-ant-10b/blob/main/config.json"
    # See all CPMAnt models at https://huggingface.co/models?filter=cpmant
}







class 	lowerCamelCase						(    A_    ):
     UpperCAmelCase__							:				List[Any] 	=						"cpmant"





     def __init__(self :       List[Any]							,       _A :       int = 3_0_7_2_0							,       _A :       int = 4_0_9_6							,       _A :       int = 3_2							,       _A :       int = 1_2_8							,       _A :       int = 1_0_2_4_0							,       _A :       int = 4_8							,       _A :       int = 0.0							,       _A :       int = 5_1_2							,       _A :       int = 2_0_4_8							,       _A :       int = 1E-6							,       _A :       float = 1.0							,       _A :       int = 3_2							,       _A :       int = 3_2							,       _A :       int = 3_2							,       _A :       bool = True							,       **_A :       Dict							,       )		->		Dict:
         super().__init__(**_A  )
         snake_case						=   prompt_types
         snake_case						=   prompt_length
         snake_case						=   segment_types
         snake_case						=   hidden_size
         snake_case						=   num_attention_heads
         snake_case						=   dim_head
         snake_case						=   dim_ff
         snake_case						=   num_hidden_layers
         snake_case						=   position_bias_num_buckets
         snake_case						=   position_bias_max_distance
         snake_case						=   dropout_p
         snake_case						=   eps
         snake_case						=   use_cache
         snake_case						=   vocab_size
         snake_case						=   init_std

