

"""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 			__a					(						__magic_name__       ,	unittest.TestCase       ):





       """simple docstring"""


       __UpperCamelCase					:      List[Any]    =						RoFormerTokenizer
       __UpperCamelCase					:      Dict    =						RoFormerTokenizerFast
       __UpperCamelCase					:      Tuple    =						True
       __UpperCamelCase					:      Dict    =						True






       def 			SCREAMING_SNAKE_CASE_	(   self   ):





        """simple docstring"""

        super().setUp()






       def 			SCREAMING_SNAKE_CASE_	(   self			,					**snake_case   ):





        """simple docstring"""

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






       def 			SCREAMING_SNAKE_CASE_	(   self			,					**snake_case   ):





        """simple docstring"""

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






       def 			SCREAMING_SNAKE_CASE_	(   self   ):





        """simple docstring"""

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






       def 			SCREAMING_SNAKE_CASE_	(   self   ):





        """simple docstring"""

        lowerCAmelCase__   :				Any 			=				self.get_tokenizer()
        lowerCAmelCase__			,						lowerCAmelCase__   :				List[Any] 			=				self.get_chinese_input_output_texts()
        lowerCAmelCase__   :				Optional[Any] 			=				tokenizer.tokenize(snake_case   )

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

        lowerCAmelCase__   :				Optional[Any] 			=				tokens + [tokenizer.unk_token]
        lowerCAmelCase__   :				Dict 			=				[22_943, 21_332, 34_431, 45_904, 117, 306, 1_231, 1_231, 2_653, 33_994, 1_266, 100]
        self.assertListEqual(tokenizer.convert_tokens_to_ids(snake_case   )			,					snake_case   )






       def 			SCREAMING_SNAKE_CASE_	(   self   ):





        """simple docstring"""

        lowerCAmelCase__   :				List[str] 			=				self.get_rust_tokenizer()
        lowerCAmelCase__			,						lowerCAmelCase__   :				Union[str, Any] 			=				self.get_chinese_input_output_texts()
        lowerCAmelCase__   :				Optional[Any] 			=				tokenizer.tokenize(snake_case   )
        self.assertListEqual(snake_case			,					output_text.split()   )
        lowerCAmelCase__   :				Optional[Any] 			=				tokens + [tokenizer.unk_token]
        lowerCAmelCase__   :				int 			=				[22_943, 21_332, 34_431, 45_904, 117, 306, 1_231, 1_231, 2_653, 33_994, 1_266, 100]
        self.assertListEqual(tokenizer.convert_tokens_to_ids(snake_case   )			,					snake_case   )






       def 			SCREAMING_SNAKE_CASE_	(   self   ):





        """simple docstring"""

        pass






       def 			SCREAMING_SNAKE_CASE_	(   self   ):





        """simple docstring"""

        pass






       def 			SCREAMING_SNAKE_CASE_	(   self   ):





        """simple docstring"""

        pass









"""simple docstring"""

from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ...utils.backbone_utils import BackboneConfigMixin, get_aligned_output_features_output_indices


_UpperCamelCase		     =    logging.get_logger(__name__)

_UpperCamelCase		     =    {
    """microsoft/focalnet-tiny""": """https://huggingface.co/microsoft/focalnet-tiny/resolve/main/config.json""",
}






class 			__a					(						__magic_name__       ,	__magic_name__       ):





       """simple docstring"""


       __UpperCamelCase					:      Optional[Any]    =						'focalnet'






       def __init__(   self			,					snake_case=224			,					snake_case=4			,					snake_case=3			,					snake_case=96			,					snake_case=False			,					snake_case=[192, 384, 768, 768]			,					snake_case=[2, 2, 6, 2]			,					snake_case=[2, 2, 2, 2]			,					snake_case=[3, 3, 3, 3]			,					snake_case="gelu"			,					snake_case=4.0			,					snake_case=0.0			,					snake_case=0.1			,					snake_case=False			,					snake_case=1e-4			,					snake_case=False			,					snake_case=False			,					snake_case=False			,					snake_case=0.02			,					snake_case=1e-5			,					snake_case=32			,					snake_case=None			,					snake_case=None			,					**snake_case			,					):





        """simple docstring"""

        super().__init__(**snake_case   )

        lowerCAmelCase__   :				Optional[Any] 			=				image_size
        lowerCAmelCase__   :				Union[str, Any] 			=				patch_size
        lowerCAmelCase__   :				List[str] 			=				num_channels
        lowerCAmelCase__   :				List[str] 			=				embed_dim
        lowerCAmelCase__   :				List[Any] 			=				use_conv_embed
        lowerCAmelCase__   :				List[str] 			=				hidden_sizes
        lowerCAmelCase__   :				List[Any] 			=				depths
        lowerCAmelCase__   :				Union[str, Any] 			=				focal_levels
        lowerCAmelCase__   :				Union[str, Any] 			=				focal_windows
        lowerCAmelCase__   :				int 			=				hidden_act
        lowerCAmelCase__   :				List[Any] 			=				mlp_ratio
        lowerCAmelCase__   :				str 			=				hidden_dropout_prob
        lowerCAmelCase__   :				Union[str, Any] 			=				drop_path_rate
        lowerCAmelCase__   :				Tuple 			=				use_layerscale
        lowerCAmelCase__   :				Tuple 			=				layerscale_value
        lowerCAmelCase__   :				str 			=				use_post_layernorm
        lowerCAmelCase__   :				str 			=				use_post_layernorm_in_modulation
        lowerCAmelCase__   :				Union[str, Any] 			=				normalize_modulator
        lowerCAmelCase__   :				Optional[int] 			=				initializer_range
        lowerCAmelCase__   :				List[Any] 			=				layer_norm_eps
        lowerCAmelCase__   :				str 			=				encoder_stride
        lowerCAmelCase__   :				Union[str, Any] 			=				["stem"] + [F"""stage{idx}""" for idx in range(1			,					len(self.depths   ) + 1   )]
        lowerCAmelCase__			,						lowerCAmelCase__   :				Union[str, Any] 			=				get_aligned_output_features_output_indices(
            out_features=snake_case			,					out_indices=snake_case			,					stage_names=self.stage_names   )






