This commit is contained in:
Ximin Luo 2025-09-11 20:43:38 +05:30 committed by GitHub
commit 83dc46504e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -369,12 +369,12 @@ def free_memory(memory_required, device, keep_loaded=[]):
unloaded_model = True
if unloaded_model:
soft_empty_cache()
soft_empty_cache(force=ALWAYS_VRAM_OFFLOAD)
else:
if vram_state != VRAMState.HIGH_VRAM:
mem_free_total, mem_free_torch = get_free_memory(device, torch_free_too=True)
if mem_free_torch > mem_free_total * 0.25:
soft_empty_cache()
soft_empty_cache(force=ALWAYS_VRAM_OFFLOAD)
def load_models_gpu(models, memory_required=0):
global vram_state