Unverified Commit cdafbcaa authored by AUTOMATIC1111's avatar AUTOMATIC1111 Committed by GitHub
Browse files

Merge pull request #13313 from chu8129/dev

use orderdict as lru cache:opt/bug
parents 34055f9d 8e355fbd
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -309,6 +309,8 @@ def get_checkpoint_state_dict(checkpoint_info: CheckpointInfo, timer):
    if checkpoint_info in checkpoints_loaded:
        # use checkpoint cache
        print(f"Loading weights [{sd_model_hash}] from cache")
        # move to end as latest
        checkpoints_loaded.move_to_end(checkpoint_info)
        return checkpoints_loaded[checkpoint_info]

    print(f"Loading weights [{sd_model_hash}] from {checkpoint_info.filename}")