





import operator as op


A_												=     "scaler.pt"
A_												=     "pytorch_model"
A_												=     "random_states"
A_												=     "optimizer"
A_												=     "scheduler"
A_												=     "pytorch_model.bin"
A_												=     "pytorch_model.bin.index.json"
A_												=     "model.safetensors"
A_												=     "model.safetensors.index.json"
A_												=     "1.10.2"
A_												=     "py38"
A_												=     "4.17.0"
A_												=     ["ml.p3.16xlarge", "ml.p3dn.24xlarge", "ml.p4dn.24xlarge"]
A_												=     ["FULL_SHARD", "SHARD_GRAD_OP", "NO_SHARD", "HYBRID_SHARD", "HYBRID_SHARD_ZERO2"]
A_												=     ["TRANSFORMER_BASED_WRAP", "SIZE_BASED_WRAP", "NO_WRAP"]
A_												=     ["BACKWARD_PRE", "BACKWARD_POST", "NO_PREFETCH"]
A_												=     ["FULL_STATE_DICT", "LOCAL_STATE_DICT", "SHARDED_STATE_DICT"]
A_												=     "2.0.1"
A_												=     ["pdsh", "standard", "openmpi", "mvapich"]
A_												=     ["default", "reduce-overhead", "max-autotune"]

A_												=     {">": op.gt, ">=": op.ge, "==": op.eq, "!=": op.ne, "<=": op.le, "<": op.lt}

# These are the args for `torch.distributed.launch` for pytorch < 1.9
A_												=     [
    "nnodes",
    "nproc_per_node",
    "rdzv_backend",
    "rdzv_endpoint",
    "rdzv_id",
    "rdzv_conf",
    "standalone",
    "max_restarts",
    "monitor_interval",
    "start_method",
    "role",
    "module",
    "m",
    "no_python",
    "run_path",
    "log_dir",
    "r",
    "redirects",
    "t",
    "tee",
    "node_rank",
    "master_addr",
    "master_port",
]

A_												=     ["DEEPSPEED", "MULTI_GPU", "FSDP", "MEGATRON_LM"]
A_												=     ["DEEPSPEED", "MULTI_XPU", "FSDP"]












import unittest

from transformers import load_tool

from .test_tools_common import ToolTesterMixin

class SCREAMING_SNAKE_CASE_ (					unittest.TestCase							,       lowercase_   ):





					"""simple docstring"""


					def 					__magic_name__ ( self	):
										lowerCamelCase__       =       load_tool("text-classification"	)
										self.tool.setup()
										lowerCamelCase__       =       load_tool("text-classification"	,  remote=_lowerCAmelCase	)





					def 					__magic_name__ ( self	):
										lowerCamelCase__       =       self.tool("That's quite cool"	,  ["positive", "negative"]	)
										self.assertEqual(_lowerCAmelCase	,  "positive"	)





					def 					__magic_name__ ( self	):
										lowerCamelCase__       =       self.remote_tool("That's quite cool"	,  ["positive", "negative"]	)
										self.assertEqual(_lowerCAmelCase	,  "positive"	)





					def 					__magic_name__ ( self	):
										lowerCamelCase__       =       self.tool(text="That's quite cool"	,  labels=["positive", "negative"]	)
										self.assertEqual(_lowerCAmelCase	,  "positive"	)






					def 					__magic_name__ ( self	):
										lowerCamelCase__       =       self.remote_tool(text="That's quite cool"	,  labels=["positive", "negative"]	)
										self.assertEqual(_lowerCAmelCase	,  "positive"	)

