1
0
Fork 0

apply sonar lint

This commit is contained in:
Sean Sube 2023-11-25 07:50:36 -06:00
parent 17e25a3bc3
commit 192bd08156
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
6 changed files with 21 additions and 20 deletions

View File

@ -218,7 +218,7 @@ class ChainPipeline:
"image does not contain sources and is within tile size of %s, running stage", "image does not contain sources and is within tile size of %s, running stage",
tile, tile,
) )
for i in range(worker.retries): for _i in range(worker.retries):
try: try:
stage_result = stage_pipe.run( stage_result = stage_pipe.run(
worker, worker,

View File

@ -95,7 +95,7 @@ def add_pipeline(name: str, pipeline: Any) -> bool:
return False return False
else: else:
available_pipelines[name] = pipeline available_pipelines[name] = pipeline
return False return True
def get_available_pipelines() -> List[str]: def get_available_pipelines() -> List[str]:

View File

@ -41,7 +41,7 @@ def get_boolean(args: Any, key: str, default_value: bool) -> bool:
return val.lower() in ("1", "t", "true", "y", "yes") return val.lower() in ("1", "t", "true", "y", "yes")
def get_list(args: Any, key: str, default = "") -> List[str]: def get_list(args: Any, key: str, default="") -> List[str]:
return split_list(args.get(key, default)) return split_list(args.get(key, default))

View File

@ -141,7 +141,7 @@ class FixXLNameTests(unittest.TestCase):
nodes = { nodes = {
"lora_unet.input_block.lora_down.weight": {}, "lora_unet.input_block.lora_down.weight": {},
} }
fixed = fix_xl_names(nodes, [""]) fixed = fix_xl_names(nodes, [NodeProto(name="test")])
self.assertEqual(fixed, nodes) self.assertEqual(fixed, nodes)

View File

@ -15,6 +15,9 @@ from onnx_web.server.context import ServerContext
from onnx_web.worker.context import WorkerContext from onnx_web.worker.context import WorkerContext
from tests.helpers import TEST_MODEL_DIFFUSION_SD15, test_device, test_needs_models from tests.helpers import TEST_MODEL_DIFFUSION_SD15, test_device, test_needs_models
TEST_PROMPT = "an astronaut eating a hamburger"
TEST_SCHEDULER = "ddim"
class TestTxt2ImgPipeline(unittest.TestCase): class TestTxt2ImgPipeline(unittest.TestCase):
@test_needs_models([TEST_MODEL_DIFFUSION_SD15]) @test_needs_models([TEST_MODEL_DIFFUSION_SD15])
@ -46,8 +49,8 @@ class TestTxt2ImgPipeline(unittest.TestCase):
ImageParams( ImageParams(
TEST_MODEL_DIFFUSION_SD15, TEST_MODEL_DIFFUSION_SD15,
"txt2img", "txt2img",
"ddim", TEST_SCHEDULER,
"an astronaut eating a hamburger", TEST_PROMPT,
3.0, 3.0,
1, 1,
1, 1,
@ -92,8 +95,8 @@ class TestTxt2ImgPipeline(unittest.TestCase):
ImageParams( ImageParams(
TEST_MODEL_DIFFUSION_SD15, TEST_MODEL_DIFFUSION_SD15,
"txt2img", "txt2img",
"ddim", TEST_SCHEDULER,
"an astronaut eating a hamburger", TEST_PROMPT,
3.0, 3.0,
1, 1,
1, 1,
@ -141,8 +144,8 @@ class TestTxt2ImgPipeline(unittest.TestCase):
ImageParams( ImageParams(
TEST_MODEL_DIFFUSION_SD15, TEST_MODEL_DIFFUSION_SD15,
"txt2img", "txt2img",
"ddim", TEST_SCHEDULER,
"an astronaut eating a hamburger", TEST_PROMPT,
3.0, 3.0,
1, 1,
1, 1,
@ -186,8 +189,8 @@ class TestTxt2ImgPipeline(unittest.TestCase):
ImageParams( ImageParams(
TEST_MODEL_DIFFUSION_SD15, TEST_MODEL_DIFFUSION_SD15,
"txt2img", "txt2img",
"ddim", TEST_SCHEDULER,
"an astronaut eating a hamburger", TEST_PROMPT,
3.0, 3.0,
1, 1,
1, 1,
@ -237,8 +240,8 @@ class TestImg2ImgPipeline(unittest.TestCase):
ImageParams( ImageParams(
TEST_MODEL_DIFFUSION_SD15, TEST_MODEL_DIFFUSION_SD15,
"txt2img", "txt2img",
"ddim", TEST_SCHEDULER,
"an astronaut eating a hamburger", TEST_PROMPT,
3.0, 3.0,
1, 1,
1, 1,
@ -284,8 +287,8 @@ class TestUpscalePipeline(unittest.TestCase):
ImageParams( ImageParams(
"../models/upscaling-stable-diffusion-x4", "../models/upscaling-stable-diffusion-x4",
"txt2img", "txt2img",
"ddim", TEST_SCHEDULER,
"an astronaut eating a hamburger", TEST_PROMPT,
3.0, 3.0,
1, 1,
1, 1,
@ -331,8 +334,8 @@ class TestBlendPipeline(unittest.TestCase):
ImageParams( ImageParams(
TEST_MODEL_DIFFUSION_SD15, TEST_MODEL_DIFFUSION_SD15,
"txt2img", "txt2img",
"ddim", TEST_SCHEDULER,
"an astronaut eating a hamburger", TEST_PROMPT,
3.0, 3.0,
1, 1,
1, 1,

View File

@ -67,7 +67,6 @@ class WorkerMainTests(unittest.TestCase):
) )
self.assertEqual(status, EXIT_INTERRUPT) self.assertEqual(status, EXIT_INTERRUPT)
pass
def test_pending_exception_retry(self): def test_pending_exception_retry(self):
status = None status = None
@ -103,7 +102,6 @@ class WorkerMainTests(unittest.TestCase):
) )
self.assertEqual(status, EXIT_ERROR) self.assertEqual(status, EXIT_ERROR)
pass
def test_pending_exception_value(self): def test_pending_exception_value(self):
status = None status = None