






from transformers import PretrainedConfig





class __lowerCamelCase			(				snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				"custom"

	def __init__(							self	,   UpperCAmelCase=1	,   **UpperCAmelCase   ):
							"""simple docstring"""







							_UpperCAmelCase     =      attribute
							super().__init__(**UpperCAmelCase   )





class __lowerCamelCase			(				snake_case__):





	"""simple docstring"""






	UpperCamelCase__								=				"custom"

	def __init__(							self	,   UpperCAmelCase=1	,   **UpperCAmelCase   ):
							"""simple docstring"""







							_UpperCAmelCase     =      attribute








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 __lowerCamelCase			:





	"""simple docstring"""






	UpperCamelCase__								=				42





class __lowerCamelCase			(				unittest.TestCase):





	"""simple docstring"""






	def 	UpperCamelCase   (							self   ):
							"""simple docstring"""







							_UpperCAmelCase     =      get_tests_dir('fixtures/test_sentencepiece.model'   )
							_UpperCAmelCase     =      get_tests_dir('fixtures/test_sentencepiece_with_bytefallback.model'   )

							_UpperCAmelCase     =      FakeOriginalTokenizer(vocab_file=UpperCAmelCase   )

							with warnings.catch_warnings(record=UpperCAmelCase   ) as w:
													_UpperCAmelCase     =      SpmConverter(UpperCAmelCase   )
							self.assertEqual(len(UpperCAmelCase   )	,   0   )

							_UpperCAmelCase     =      FakeOriginalTokenizer(vocab_file=UpperCAmelCase   )

							with warnings.catch_warnings(record=UpperCAmelCase   ) as w:
													_UpperCAmelCase     =      SpmConverter(UpperCAmelCase   )
							self.assertEqual(len(UpperCAmelCase   )	,   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   )	,   )
