Convert formatting to use ruff instead of yapf + isort (#26247)
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
@@ -13,13 +13,13 @@ from .utils import ARGS, CONFIGS, ServerConfig
|
||||
|
||||
# select models to test based on command line arguments
|
||||
def pytest_addoption(parser):
|
||||
parser.addoption("--models",
|
||||
nargs="+",
|
||||
help="Specify one or more models to test")
|
||||
parser.addoption("--extended",
|
||||
action="store_true",
|
||||
default=False,
|
||||
help="invoke extended tests requiring large GPUs")
|
||||
parser.addoption("--models", nargs="+", help="Specify one or more models to test")
|
||||
parser.addoption(
|
||||
"--extended",
|
||||
action="store_true",
|
||||
default=False,
|
||||
help="invoke extended tests requiring large GPUs",
|
||||
)
|
||||
|
||||
|
||||
# for each server config, download the model and return the config
|
||||
@@ -29,8 +29,10 @@ def server_config(request):
|
||||
models = request.config.getoption("--models")
|
||||
|
||||
config_keys_to_test = [
|
||||
key for key in CONFIGS if (models is None or key in models) and (
|
||||
extended or not CONFIGS[key].get("extended", False))
|
||||
key
|
||||
for key in CONFIGS
|
||||
if (models is None or key in models)
|
||||
and (extended or not CONFIGS[key].get("extended", False))
|
||||
]
|
||||
|
||||
config_key = request.param
|
||||
@@ -40,8 +42,9 @@ def server_config(request):
|
||||
config = CONFIGS[config_key]
|
||||
|
||||
if current_platform.is_rocm() and not config.get("supports_rocm", True):
|
||||
pytest.skip("The {} model can't be tested on the ROCm platform".format(
|
||||
config["model"]))
|
||||
pytest.skip(
|
||||
"The {} model can't be tested on the ROCm platform".format(config["model"])
|
||||
)
|
||||
|
||||
# download model and tokenizer using transformers
|
||||
snapshot_download(config["model"])
|
||||
@@ -53,8 +56,9 @@ def server_config(request):
|
||||
def server(request, server_config: ServerConfig):
|
||||
model = server_config["model"]
|
||||
args_for_model = server_config["arguments"]
|
||||
with RemoteOpenAIServer(model, ARGS + args_for_model,
|
||||
max_wait_seconds=480) as server:
|
||||
with RemoteOpenAIServer(
|
||||
model, ARGS + args_for_model, max_wait_seconds=480
|
||||
) as server:
|
||||
yield server
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user