
"""simple docstring"""




from typing import TYPE_CHECKING

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


A__      :	Dict          =    {
    """configuration_biogpt""": ["""BIOGPT_PRETRAINED_CONFIG_ARCHIVE_MAP""", """BioGptConfig"""],
    """tokenization_biogpt""": ["""BioGptTokenizer"""],
}

try:
    if not is_torch_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    A__      :	Optional[int]          =    [
        """BIOGPT_PRETRAINED_MODEL_ARCHIVE_LIST""",
        """BioGptForCausalLM""",
        """BioGptForTokenClassification""",
        """BioGptForSequenceClassification""",
        """BioGptModel""",
        """BioGptPreTrainedModel""",
    ]


if TYPE_CHECKING:
    from .configuration_biogpt import BIOGPT_PRETRAINED_CONFIG_ARCHIVE_MAP, BioGptConfig
    from .tokenization_biogpt import BioGptTokenizer

    try:
        if not is_torch_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .modeling_biogpt import (
            BIOGPT_PRETRAINED_MODEL_ARCHIVE_LIST,
            BioGptForCausalLM,
            BioGptForSequenceClassification,
            BioGptForTokenClassification,
            BioGptModel,
            BioGptPreTrainedModel,
        )


else:
    import sys

    A__      :	str          =    _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   _lowercase						(       unittest.TestCase	,   lowerCAmelCase_				):


     '''simple docstring'''





     def  lowerCAmelCase__       (      self  )->					Dict:
          UpperCAmelCase__							: Optional[Any] 							=						load_tool("text-classification"  )
          self.tool.setup()
          UpperCAmelCase__							: List[str] 							=						load_tool("text-classification" ,			remote=__UpperCamelCase  )



     def  lowerCAmelCase__       (      self  )->					Union[str, Any]:
          UpperCAmelCase__							: Dict 							=						self.tool("That's quite cool" ,			["positive", "negative"]  )
          self.assertEqual(__UpperCamelCase ,			"positive"  )



     def  lowerCAmelCase__       (      self  )->					str:
          UpperCAmelCase__							: List[Any] 							=						self.remote_tool("That's quite cool" ,			["positive", "negative"]  )
          self.assertEqual(__UpperCamelCase ,			"positive"  )



     def  lowerCAmelCase__       (      self  )->					Optional[int]:
          UpperCAmelCase__							: Any 							=						self.tool(text="That's quite cool" ,			labels=["positive", "negative"]  )
          self.assertEqual(__UpperCamelCase ,			"positive"  )



     def  lowerCAmelCase__       (      self  )->					str:
          UpperCAmelCase__							: str 							=						self.remote_tool(text="That's quite cool" ,			labels=["positive", "negative"]  )
          self.assertEqual(__UpperCamelCase ,			"positive"  )



