

"""simple docstring"""





from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_sentencepiece_available,
    is_tokenizers_available,
    is_torch_available,
)


_a       =							{'configuration_fnet': ['FNET_PRETRAINED_CONFIG_ARCHIVE_MAP', 'FNetConfig']}

try:
   if not is_sentencepiece_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   _a       =							['FNetTokenizer']

try:
   if not is_tokenizers_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   _a       =							['FNetTokenizerFast']

try:
   if not is_torch_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   _a       =							[
       'FNET_PRETRAINED_MODEL_ARCHIVE_LIST',
       'FNetForMaskedLM',
       'FNetForMultipleChoice',
       'FNetForNextSentencePrediction',
       'FNetForPreTraining',
       'FNetForQuestionAnswering',
       'FNetForSequenceClassification',
       'FNetForTokenClassification',
       'FNetLayer',
       'FNetModel',
       'FNetPreTrainedModel',
   ]


if TYPE_CHECKING:
   from .configuration_fnet import FNET_PRETRAINED_CONFIG_ARCHIVE_MAP, FNetConfig

   try:
      if not is_sentencepiece_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .tokenization_fnet import FNetTokenizer

   try:
      if not is_tokenizers_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .tokenization_fnet_fast import FNetTokenizerFast

   try:
      if not is_torch_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_fnet import (
          FNET_PRETRAINED_MODEL_ARCHIVE_LIST,
          FNetForMaskedLM,
          FNetForMultipleChoice,
          FNetForNextSentencePrediction,
          FNetForPreTraining,
          FNetForQuestionAnswering,
          FNetForSequenceClassification,
          FNetForTokenClassification,
          FNetLayer,
          FNetModel,
          FNetPreTrainedModel,
      )


else:
   import sys

   _a       =							_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)







"""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"	)




