1
0
Fork 0

fix(api): only run GC when a diffusion model has been replaced

This commit is contained in:
Sean Sube 2023-03-11 08:06:03 -06:00
parent a195bc100d
commit cb2b054fde
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
1 changed files with 3 additions and 3 deletions

View File

@ -190,9 +190,9 @@ def load_pipeline(
run_gc([device])
else:
logger.debug("unloading previous diffusion pipeline")
server.cache.drop("diffusion", pipe_key)
run_gc([device])
if server.cache.drop("diffusion", pipe_key) > 0:
logger.debug("unloading previous diffusion pipeline")
run_gc([device])
if lpw:
custom_pipeline = "./onnx_web/diffusers/lpw_stable_diffusion_onnx.py"