1
0
Fork 0

apply sonar lint

This commit is contained in:
Sean Sube 2023-02-19 07:53:20 -06:00
parent 30978e3e5b
commit c69e342ee4
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
8 changed files with 9 additions and 15 deletions

View File

@ -113,5 +113,5 @@ def blend_inpaint(
output = process_tile_order(stage.tile_order, source, SizeChart.auto, 1, [outpaint])
logger.info("final output image size", output.size)
logger.info("final output image size: %s", output.size)
return output

View File

@ -13,7 +13,7 @@ def source_noise(
_job: JobContext,
_server: ServerContext,
_stage: StageParams,
params: ImageParams,
_params: ImageParams,
source: Image.Image,
*,
size: Size,

View File

@ -149,7 +149,7 @@ def fetch_model(
if model_format is None:
url = urlparse(source)
ext = path.basename(url.path)
file, ext = path.splitext(ext)
_filename, ext = path.splitext(ext)
if ext is not None:
cache_name += ext
else:

View File

@ -1397,8 +1397,6 @@ def extract_checkpoint(
logger.info(result_status)
return
def convert_diffusion_original(
ctx: ConversionContext,

View File

@ -214,12 +214,12 @@ def load_tensor(name: str, map_location=None):
except Exception as e:
try:
logger.warning(
"failed to load as safetensors file, falling back to torch", e
"failed to load as safetensors file, falling back to torch: %s", e
)
checkpoint = torch.jit.load(name)
except Exception as e:
logger.warning(
"failed to load with Torch JIT, falling back to PyTorch", e
"failed to load with Torch JIT, falling back to PyTorch: %s", e
)
checkpoint = torch.load(name, map_location=map_location)
checkpoint = (

View File

@ -173,7 +173,6 @@ def run_inpaint_pipeline(
fill_color: str,
tile_order: str,
) -> None:
# device = job.get_device()
progress = job.get_progress_callback()
stage = StageParams(tile_order=tile_order)
@ -218,7 +217,6 @@ def run_upscale_pipeline(
upscale: UpscaleParams,
source: Image.Image,
) -> None:
# device = job.get_device()
progress = job.get_progress_callback()
stage = StageParams()

View File

@ -208,7 +208,6 @@ class DevicePoolExecutor:
except ValueError as e:
logger.warning("error removing pruned job from pending: %s", e)
# self.jobs[:] = [job for job in self.jobs if not job.future.done()]
recent_count = len(self.recent)
if recent_count > self.recent_limit:
logger.debug(

View File

@ -31,11 +31,10 @@ class ModelCache:
for i in range(len(self.cache)):
t, k, v = self.cache[i]
if tag == t:
if key != k:
logger.debug("updating model cache: %s", tag)
self.cache[i] = (tag, key, value)
return
if tag == t and key != k:
logger.debug("updating model cache: %s", tag)
self.cache[i] = (tag, key, value)
return
logger.debug("adding new model to cache: %s", tag)
self.cache.append((tag, key, value))