



from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


snake_case    :						int  ={
    'configuration_nllb_moe': [
        'NLLB_MOE_PRETRAINED_CONFIG_ARCHIVE_MAP',
        'NllbMoeConfig',
    ]
}

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		snake_case    :						Any  =[
		    'NLLB_MOE_PRETRAINED_MODEL_ARCHIVE_LIST',
		    'NllbMoeForConditionalGeneration',
		    'NllbMoeModel',
		    'NllbMoePreTrainedModel',
		    'NllbMoeTop2Router',
		    'NllbMoeSparseMLP',
		]


if TYPE_CHECKING:
		from .configuration_nllb_moe import (
		    NLLB_MOE_PRETRAINED_CONFIG_ARCHIVE_MAP,
		    NllbMoeConfig,
		)

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_nllb_moe import (
				    NLLB_MOE_PRETRAINED_MODEL_ARCHIVE_LIST,
				    NllbMoeForConditionalGeneration,
				    NllbMoeModel,
				    NllbMoePreTrainedModel,
				    NllbMoeSparseMLP,
				    NllbMoeTopaRouter,
				)


else:
		import sys

		snake_case    :						Optional[Any]  =_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)




import unittest

from transformers import load_tool

from .test_tools_common import ToolTesterMixin




class 							lowerCAmelCase__  (	unittest.TestCase					,							UpperCamelCase						):







					def  _lowercase			(       self      :     List[Any]):
											A__	:							Optional[Any]						    = load_tool("text-classification")
											self.tool.setup()
											A__	:							Any						    = load_tool("text-classification"			,		remote=_A)







					def  _lowercase			(       self      :     List[Any]):
											A__	:							Optional[Any]						    = self.tool("That's quite cool"			,		["positive", "negative"])
											self.assertEqual(_A			,		"positive")







					def  _lowercase			(       self      :     List[str]):
											A__	:							Any						    = self.remote_tool("That's quite cool"			,		["positive", "negative"])
											self.assertEqual(_A			,		"positive")







					def  _lowercase			(       self      :     Optional[Any]):
											A__	:							List[str]						    = self.tool(text="That's quite cool"			,		labels=["positive", "negative"])
											self.assertEqual(_A			,		"positive")







					def  _lowercase			(       self      :     Tuple):
											A__	:							Union[str, Any]						    = self.remote_tool(text="That's quite cool"			,		labels=["positive", "negative"])
											self.assertEqual(_A			,		"positive")