
'''simple docstring'''





import unittest
import warnings
from dataclasses import dataclass

from transformers.convert_slow_tokenizer import SpmConverter
from transformers.testing_utils import get_tests_dir

@dataclass
class     a :
				_snake_case		     =			42




class     a (					unittest.TestCase     ):




				def 						__snake_case				(				self						:					int   ):
										snake_case							:  int			=     get_tests_dir('''fixtures/test_sentencepiece.model'''   )
										snake_case							:  str			=     get_tests_dir('''fixtures/test_sentencepiece_with_bytefallback.model'''   )

										snake_case							:  Tuple			=     FakeOriginalTokenizer(vocab_file=SCREAMING_SNAKE_CASE_   )

										with warnings.catch_warnings(record=SCREAMING_SNAKE_CASE_   ) as w:
																snake_case							:  Union[str, Any]			=     SpmConverter(SCREAMING_SNAKE_CASE_   )
										self.assertEqual(len(SCREAMING_SNAKE_CASE_   ),     0   )

										snake_case							:  Optional[Any]			=     FakeOriginalTokenizer(vocab_file=SCREAMING_SNAKE_CASE_   )

										with warnings.catch_warnings(record=SCREAMING_SNAKE_CASE_   ) as w:
																snake_case							:  int			=     SpmConverter(SCREAMING_SNAKE_CASE_   )
										self.assertEqual(len(SCREAMING_SNAKE_CASE_   ),     1   )

										self.assertIn(
										    '''The sentencepiece tokenizer that you are converting to a fast tokenizer uses the byte fallback option'''
										    ''' which is not implemented in the fast tokenizers.''',     str(w[0].message   ),     )



import torch

from transformers import PreTrainedModel

from .custom_configuration import CustomConfig, NoSuperInitConfig





class 				UpperCamelCase__		(	__SCREAMING_SNAKE_CASE	):






       """simple docstring"""


       UpperCAmelCase_				       =CustomConfig



       def __init__(							self ,     _A	)				->				int:
          super().__init__(_A	)
          SCREAMING_SNAKE_CASE_	=      torch.nn.Linear(config.hidden_size ,     config.hidden_size	)



       def     _UpperCamelCase	(							self ,     _A	)				->				Optional[int]:
          return self.linear(_A	)




       def     _UpperCamelCase	(							self ,     _A	)				->				int:
          pass







class 				UpperCamelCase__		(	__SCREAMING_SNAKE_CASE	):






       """simple docstring"""


       UpperCAmelCase_				       =NoSuperInitConfig



       def __init__(							self ,     _A	)				->				Optional[int]:
          super().__init__(_A	)
          SCREAMING_SNAKE_CASE_	=      torch.nn.Linear(config.attribute ,     config.attribute	)



       def     _UpperCamelCase	(							self ,     _A	)				->				Any:
          return self.linear(_A	)




       def     _UpperCamelCase	(							self ,     _A	)				->				Tuple:
          pass


