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]) 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 return output

View File

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

View File

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

View File

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

View File

@ -214,12 +214,12 @@ def load_tensor(name: str, map_location=None):
except Exception as e: except Exception as e:
try: try:
logger.warning( 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) checkpoint = torch.jit.load(name)
except Exception as e: except Exception as e:
logger.warning( 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 = torch.load(name, map_location=map_location)
checkpoint = ( checkpoint = (

View File

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

View File

@ -208,7 +208,6 @@ class DevicePoolExecutor:
except ValueError as e: except ValueError as e:
logger.warning("error removing pruned job from pending: %s", 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) recent_count = len(self.recent)
if recent_count > self.recent_limit: if recent_count > self.recent_limit:
logger.debug( logger.debug(

View File

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