mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Fix bug in model cache reference count checking.
This commit is contained in:
parent
8488ab0134
commit
fb3d0c4b12
@ -474,11 +474,11 @@ class ModelCache(object):
|
|||||||
f" refs: {refs}"
|
f" refs: {refs}"
|
||||||
)
|
)
|
||||||
|
|
||||||
# 2 refs:
|
# Expected refs:
|
||||||
# 1 from cache_entry
|
# 1 from cache_entry
|
||||||
# 1 from getrefcount function
|
# 1 from getrefcount function
|
||||||
# 1 from onnx runtime object
|
# 1 from onnx runtime object
|
||||||
if not cache_entry.locked and refs <= 3 if "onnx" in model_key else 2:
|
if not cache_entry.locked and refs <= (3 if "onnx" in model_key else 2):
|
||||||
self.logger.debug(
|
self.logger.debug(
|
||||||
f"Unloading model {model_key} to free {(model_size/GIG):.2f} GB (-{(cache_entry.size/GIG):.2f} GB)"
|
f"Unloading model {model_key} to free {(model_size/GIG):.2f} GB (-{(cache_entry.size/GIG):.2f} GB)"
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user