mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
clear cache on all exceptions
This commit is contained in:
parent
46d23cd868
commit
651c0b39b1
@ -273,7 +273,7 @@ class ModelCache(ModelCacheBase[AnyModel]):
|
|||||||
snapshot_before = self._capture_memory_snapshot()
|
snapshot_before = self._capture_memory_snapshot()
|
||||||
try:
|
try:
|
||||||
cache_entry.model.to(target_device)
|
cache_entry.model.to(target_device)
|
||||||
except RuntimeError as e: # blow away cache entry
|
except Exception as e: # blow away cache entry
|
||||||
self._delete_cache_entry(cache_entry)
|
self._delete_cache_entry(cache_entry)
|
||||||
raise e
|
raise e
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user