Fix memory issues when installing models on Windows by gogurtenjoyer · Pull Request #8652 · invoke-ai/InvokeAI

added 2 commits

November 3, 2025 16:45
Wrap gguf.GGUFReader and then use a context manager to load memory-mapped GGUF files, so that they will automatically close properly when no longer needed. Should prevent the 'file in use in another process' errors on Windows.
Additional check for cached state_dict as path is now optional - should solve model manager 'missing' this and the resultant memory errors.

@gogurtenjoyer

@gogurtenjoyer

@gogurtenjoyer gogurtenjoyer changed the title Fix installing models on Windows Fix memory issues when installing models on Windows

Nov 4, 2025

@gogurtenjoyer

@gogurtenjoyer

lstein

@gogurtenjoyer

No longer attempting to delete internal object.

@gogurtenjoyer

@lstein

@lstein