Fix model cache gc.collect() condition. (#5036)

See
https://github.com/invoke-ai/InvokeAI/pull/5034#discussion_r1382381733
This commit is contained in:
Ryan Dick 2023-11-04 09:09:46 -04:00 committed by GitHub
commit 2bbba323c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -493,7 +493,7 @@ class ModelCache(object):
else:
pos += 1
if models_cleared < 0:
if models_cleared > 0:
# There would likely be some 'garbage' to be collected regardless of whether a model was cleared or not, but
# there is a significant time cost to calling `gc.collect()`, so we want to use it sparingly. (The time cost
# is high even if no garbage gets collected.)