
"""simple docstring"""


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  lowerCAmelCase_ (					_lowercase						,    unittest.TestCase			):



						'''simple docstring'''


						_lowerCamelCase:			List[Any]					=			RoFormerTokenizer
						_lowerCamelCase:			Any					=			RoFormerTokenizerFast
						_lowerCamelCase:			Optional[int]					=			True
						_lowerCamelCase:			Any					=			True


						def   _SCREAMING_SNAKE_CASE					(       self   :					Optional[int]					)   ->      List[str]:
							super().setUp()


						def   _SCREAMING_SNAKE_CASE					(       self   :					Union[str, Any]     ,**A_   :					Tuple					)   ->      Any:
							return self.tokenizer_class.from_pretrained('junnyu/roformer_chinese_base'     ,**A_					)


						def   _SCREAMING_SNAKE_CASE					(       self   :					Optional[Any]     ,**A_   :					Optional[int]					)   ->      Dict:
							return self.rust_tokenizer_class.from_pretrained('junnyu/roformer_chinese_base'     ,**A_					)


						def   _SCREAMING_SNAKE_CASE					(       self   :					Optional[Any]					)   ->      Union[str, Any]:
							A        =      '永和服装饰品有限公司,今天天气非常好'
							A        =      '永和 服装 饰品 有限公司 , 今 天 天 气 非常 好'
							return input_text, output_text


						def   _SCREAMING_SNAKE_CASE					(       self   :					Optional[Any]					)   ->      Dict:
							A        =      self.get_tokenizer()
							A      ,					A        =      self.get_chinese_input_output_texts()
							A        =      tokenizer.tokenize(A_					)

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

							A        =      tokens + [tokenizer.unk_token]
							A        =      [2_2943, 2_1332, 3_4431, 4_5904, 117, 306, 1231, 1231, 2653, 3_3994, 1266, 100]
							self.assertListEqual(tokenizer.convert_tokens_to_ids(A_					)     ,A_					)


						def   _SCREAMING_SNAKE_CASE					(       self   :					Tuple					)   ->      Optional[int]:
							A        =      self.get_rust_tokenizer()
							A      ,					A        =      self.get_chinese_input_output_texts()
							A        =      tokenizer.tokenize(A_					)
							self.assertListEqual(A_     ,output_text.split()					)
							A        =      tokens + [tokenizer.unk_token]
							A        =      [2_2943, 2_1332, 3_4431, 4_5904, 117, 306, 1231, 1231, 2653, 3_3994, 1266, 100]
							self.assertListEqual(tokenizer.convert_tokens_to_ids(A_					)     ,A_					)


						def   _SCREAMING_SNAKE_CASE					(       self   :					Dict					)   ->      Optional[Any]:
							pass


						def   _SCREAMING_SNAKE_CASE					(       self   :					Tuple					)   ->      Optional[int]:
							pass




						def   _SCREAMING_SNAKE_CASE					(       self   :					Any					)   ->      List[Any]:
							pass


"""simple docstring"""





import unittest

from transformers import load_tool

from .test_tools_common import ToolTesterMixin




class 					_lowerCAmelCase  (	unittest.TestCase     ,lowercase   ):







 """simple docstring"""







 def 					_lowercase (			self							:			List[Any]	):
    __lowercase								=						load_tool("text-classification"	)
    self.tool.setup()
    __lowercase								=						load_tool("text-classification",					remote=UpperCAmelCase__	)


 def 					_lowercase (			self							:			str	):
    __lowercase								=						self.tool("That's quite cool",					["positive", "negative"]	)
    self.assertEqual(UpperCAmelCase__,					"positive"	)


 def 					_lowercase (			self							:			str	):
    __lowercase								=						self.remote_tool("That's quite cool",					["positive", "negative"]	)
    self.assertEqual(UpperCAmelCase__,					"positive"	)


 def 					_lowercase (			self							:			List[str]	):
    __lowercase								=						self.tool(text="That's quite cool",					labels=["positive", "negative"]	)
    self.assertEqual(UpperCAmelCase__,					"positive"	)



 def 					_lowercase (			self							:			Tuple	):
    __lowercase								=						self.remote_tool(text="That's quite cool",					labels=["positive", "negative"]	)
    self.assertEqual(UpperCAmelCase__,					"positive"	)




