Add force refresh to LoRA Loader refresh function (#2584)

This commit is contained in:
hako-mikan 2025-01-29 06:04:44 +09:00 committed by GitHub
parent b835f24a4d
commit daee4c0d8f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -299,10 +299,10 @@ class LoraLoader:
self.loaded_hash = str([])
@torch.inference_mode()
def refresh(self, lora_patches, offload_device=torch.device('cpu')):
def refresh(self, lora_patches, offload_device=torch.device('cpu'), force_refresh = False):
hashes = str(list(lora_patches.keys()))
if hashes == self.loaded_hash:
if hashes == self.loaded_hash and not force_refresh:
return
# Merge Patches