




import unittest

from transformers import RoFormerTokenizer, RoFormerTokenizerFast
from transformers.testing_utils import require_rjieba, require_tokenizers

from ...test_tokenization_common import TokenizerTesterMixin




@require_rjieba
@require_tokenizers
class 		__A   (      UpperCamelCase__       ,    unittest.TestCase      ):
						UpperCamelCase      =       RoFormerTokenizer
						UpperCamelCase      =       RoFormerTokenizerFast
						UpperCamelCase      =       True
						UpperCamelCase      =       True

						def      A__    (		self :List[str]			):
										'''simple docstring'''

										super().setUp()

						def      A__    (		self :List[str]     ,			**__snake_case :str			):
										'''simple docstring'''

										return self.tokenizer_class.from_pretrained("""junnyu/roformer_chinese_base"""     ,			**__snake_case			)

						def      A__    (		self :str     ,			**__snake_case :Dict			):
										'''simple docstring'''

										return self.rust_tokenizer_class.from_pretrained("""junnyu/roformer_chinese_base"""     ,			**__snake_case			)

						def      A__    (		self :Optional[int]			):
										'''simple docstring'''

										__magic_name__						:						List[str]										="""永和服装饰品有限公司,今天天气非常好"""
										__magic_name__						:						Any										="""永和 服装 饰品 有限公司 , 今 天 天 气 非常 好"""
										return input_text, output_text

						def      A__    (		self :Dict			):
										'''simple docstring'''

										__magic_name__						:						Optional[Any]										=self.get_tokenizer()
										__magic_name__					,			__magic_name__						:						Optional[int]										=self.get_chinese_input_output_texts()
										__magic_name__						:						Any										=tokenizer.tokenize(__snake_case			)

										self.assertListEqual(__snake_case     ,			output_text.split()			)

										__magic_name__						:						Any										=tokens + [tokenizer.unk_token]
										__magic_name__						:						Union[str, Any]										=[2_29_43, 2_13_32, 3_44_31, 4_59_04, 1_17, 3_06, 12_31, 12_31, 26_53, 3_39_94, 12_66, 1_00]
										self.assertListEqual(tokenizer.convert_tokens_to_ids(__snake_case			)     ,			__snake_case			)

						def      A__    (		self :Any			):
										'''simple docstring'''

										__magic_name__						:						str										=self.get_rust_tokenizer()
										__magic_name__					,			__magic_name__						:						Any										=self.get_chinese_input_output_texts()
										__magic_name__						:						Any										=tokenizer.tokenize(__snake_case			)
										self.assertListEqual(__snake_case     ,			output_text.split()			)
										__magic_name__						:						Optional[int]										=tokens + [tokenizer.unk_token]
										__magic_name__						:						Any										=[2_29_43, 2_13_32, 3_44_31, 4_59_04, 1_17, 3_06, 12_31, 12_31, 26_53, 3_39_94, 12_66, 1_00]
										self.assertListEqual(tokenizer.convert_tokens_to_ids(__snake_case			)     ,			__snake_case			)

						def      A__    (		self :Tuple			):
										'''simple docstring'''

										pass

						def      A__    (		self :Dict			):
										'''simple docstring'''

										pass


						def      A__    (		self :Tuple			):
										'''simple docstring'''

										pass











'''simple docstring'''




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


lowercase__       : List[Any]         =       logging.get_logger(__name__)

lowercase__       : Optional[int]         =       {
    '''unc-nlp/lxmert-base-uncased''': '''https://huggingface.co/unc-nlp/lxmert-base-uncased/resolve/main/config.json''',
}


class 					SCREAMING_SNAKE_CASE       (a__				):
     lowerCAmelCase						     =			'''lxmert'''
     lowerCAmelCase						     =			{}


     def __init__(		self		,      _UpperCAmelCase=3_0522		,      _UpperCAmelCase=768		,      _UpperCAmelCase=12		,      _UpperCAmelCase=9500		,      _UpperCAmelCase=1600		,      _UpperCAmelCase=400		,      _UpperCAmelCase=3072		,      _UpperCAmelCase="gelu"		,      _UpperCAmelCase=0.1		,      _UpperCAmelCase=0.1		,      _UpperCAmelCase=512		,      _UpperCAmelCase=2		,      _UpperCAmelCase=0.02		,      _UpperCAmelCase=1e-1_2		,      _UpperCAmelCase=9		,      _UpperCAmelCase=5		,      _UpperCAmelCase=5		,      _UpperCAmelCase=2048		,      _UpperCAmelCase=4		,      _UpperCAmelCase=6.67		,      _UpperCAmelCase=True		,      _UpperCAmelCase=True		,      _UpperCAmelCase=True		,      _UpperCAmelCase=True		,      _UpperCAmelCase=True		,      _UpperCAmelCase=True		,      _UpperCAmelCase=True		,      **_UpperCAmelCase		,      ):

          '''simple docstring'''






          __A		:					Tuple						=			vocab_size
          __A		:					int						=			hidden_size
          __A		:					str						=			num_attention_heads
          __A		:					Tuple						=			hidden_act
          __A		:					int						=			intermediate_size
          __A		:					str						=			hidden_dropout_prob
          __A		:					Optional[int]						=			attention_probs_dropout_prob
          __A		:					Optional[Any]						=			max_position_embeddings
          __A		:					Tuple						=			type_vocab_size
          __A		:					Optional[int]						=			initializer_range
          __A		:					Any						=			layer_norm_eps
          __A		:					Optional[Any]						=			num_qa_labels
          __A		:					Optional[int]						=			num_object_labels
          __A		:					Any						=			num_attr_labels
          __A		:					Union[str, Any]						=			l_layers
          __A		:					Optional[int]						=			x_layers
          __A		:					List[Any]						=			r_layers
          __A		:					Tuple						=			visual_feat_dim
          __A		:					Tuple						=			visual_pos_dim
          __A		:					Optional[int]						=			visual_loss_normalizer
          __A		:					int						=			task_matched
          __A		:					List[Any]						=			task_mask_lm
          __A		:					Optional[Any]						=			task_obj_predict
          __A		:					str						=			task_qa
          __A		:					List[Any]						=			visual_obj_loss
          __A		:					Optional[Any]						=			visual_attr_loss
          __A		:					Union[str, Any]						=			visual_feat_loss
          __A		:					Union[str, Any]						=			{'vision': r_layers, 'cross_encoder': x_layers, 'language': l_layers}
          super().__init__(**_UpperCAmelCase)