when model is forcibly moved into RAM update loaded_models set

This commit is contained in:
Lincoln Stein 2023-05-04 23:28:03 -04:00
parent 68bc0112fa
commit a4e36bc02a

View File

@ -178,6 +178,7 @@ class ModelCache(object):
if hasattr(model,'to') and (key in self.loaded_models
and self.locked_models[key] == 0):
model.to(self.storage_device)
self.loaded_models.remove(key)
yield model
def _offload_unlocked_models(self):