

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__  :
			"""simple docstring"""







			__lowerCamelCase	    =    42

class    a__  (   unittest.TestCase     ):
			"""simple docstring"""







			def        UpperCamelCase						(      self    )					->  int:
							'''simple docstring'''






							A__            =     get_tests_dir("fixtures/test_sentencepiece.model"    )
							A__            =     get_tests_dir("fixtures/test_sentencepiece_with_bytefallback.model"    )

							A__            =     FakeOriginalTokenizer(vocab_file=lowercase    )

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

							A__            =     FakeOriginalTokenizer(vocab_file=lowercase    )

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




from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


lowerCAmelCase__						=	{"""configuration_nat""": ["""NAT_PRETRAINED_CONFIG_ARCHIVE_MAP""", """NatConfig"""]}


try:
	if not is_torch_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	lowerCAmelCase__						=	[
	    """NAT_PRETRAINED_MODEL_ARCHIVE_LIST""",
	    """NatForImageClassification""",
	    """NatModel""",
	    """NatPreTrainedModel""",
	    """NatBackbone""",
	]

if TYPE_CHECKING:
	from .configuration_nat import NAT_PRETRAINED_CONFIG_ARCHIVE_MAP, NatConfig

	try:
		if not is_torch_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .modeling_nat import (
		    NAT_PRETRAINED_MODEL_ARCHIVE_LIST,
		    NatBackbone,
		    NatForImageClassification,
		    NatModel,
		    NatPreTrainedModel,
		)

else:
	import sys

	lowerCAmelCase__						=	_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)

