






import unittest

from transformers import load_tool

from .test_tools_common import ToolTesterMixin


class 			SCREAMING_SNAKE_CASE      (      unittest.TestCase   ,		lowerCAmelCase       ):
     '''simple docstring'''


     def 					_A							(					self							:						List[Any]   ):
       SCREAMING_SNAKE_CASE							:   List[str]						    =     load_tool("text-classification"   )
       self.tool.setup()
       SCREAMING_SNAKE_CASE							:   int						    =     load_tool("text-classification"       ,			remote=UpperCAmelCase_   )


     def 					_A							(					self							:						Tuple   ):
       SCREAMING_SNAKE_CASE							:   str						    =     self.tool("That's quite cool"       ,			["positive", "negative"]   )
       self.assertEqual(UpperCAmelCase_       ,			"positive"   )


     def 					_A							(					self							:						Optional[int]   ):
       SCREAMING_SNAKE_CASE							:   Optional[int]						    =     self.remote_tool("That's quite cool"       ,			["positive", "negative"]   )
       self.assertEqual(UpperCAmelCase_       ,			"positive"   )


     def 					_A							(					self							:						Dict   ):
       SCREAMING_SNAKE_CASE							:   Union[str, Any]						    =     self.tool(text="That's quite cool"       ,			labels=["positive", "negative"]   )
       self.assertEqual(UpperCAmelCase_       ,			"positive"   )






     def 					_A							(					self							:						Optional[Any]   ):
       SCREAMING_SNAKE_CASE							:   Any						    =     self.remote_tool(text="That's quite cool"       ,			labels=["positive", "negative"]   )
       self.assertEqual(UpperCAmelCase_       ,			"positive"   )








from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tokenizers_available, is_torch_available


__lowerCAmelCase					   =       {
    'configuration_bloom': ['BLOOM_PRETRAINED_CONFIG_ARCHIVE_MAP', 'BloomConfig', 'BloomOnnxConfig'],
}
try:
							if not is_tokenizers_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							__lowerCAmelCase					   =       ['BloomTokenizerFast']

try:
							if not is_torch_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							__lowerCAmelCase					   =       [
							    'BLOOM_PRETRAINED_MODEL_ARCHIVE_LIST',
							    'BloomForCausalLM',
							    'BloomModel',
							    'BloomPreTrainedModel',
							    'BloomForSequenceClassification',
							    'BloomForTokenClassification',
							    'BloomForQuestionAnswering',
							]

if TYPE_CHECKING:
							from .configuration_bloom import BLOOM_PRETRAINED_CONFIG_ARCHIVE_MAP, BloomConfig, BloomOnnxConfig

							try:
														if not is_tokenizers_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .tokenization_bloom_fast import BloomTokenizerFast

							try:
														if not is_torch_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_bloom import (
														    BLOOM_PRETRAINED_MODEL_ARCHIVE_LIST,
														    BloomForCausalLM,
														    BloomForQuestionAnswering,
														    BloomForSequenceClassification,
														    BloomForTokenClassification,
														    BloomModel,
														    BloomPreTrainedModel,
														)

else:
							import sys

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