mirror of
https://github.com/invoke-ai/InvokeAI.git
synced 2026-04-23 03:00:31 -04:00
Fix a couple of bugs to get basic vanilla partial model load working with the model cache.
This commit is contained in:
@@ -75,7 +75,7 @@ class LoadedModelWithoutConfig:
|
||||
@property
|
||||
def model(self) -> AnyModel:
|
||||
"""Return the model without locking it."""
|
||||
return self._cache_record.model
|
||||
return self._cache_record.cached_model.model
|
||||
|
||||
|
||||
class LoadedModel(LoadedModelWithoutConfig):
|
||||
|
||||
@@ -219,9 +219,11 @@ class ModelCache:
|
||||
# self._print_cuda_stats()
|
||||
except torch.cuda.OutOfMemoryError:
|
||||
self._logger.warning("Insufficient GPU memory to load model. Aborting")
|
||||
raise
|
||||
finally:
|
||||
cache_entry.unlock()
|
||||
raise
|
||||
except Exception:
|
||||
cache_entry.unlock()
|
||||
raise
|
||||
|
||||
# try:
|
||||
# if self._lazy_offloading:
|
||||
|
||||
Reference in New Issue
Block a user