Skip to content

Commit

Permalink
Merge pull request AUTOMATIC1111#13313 from chu8129/dev
Browse files Browse the repository at this point in the history
use orderdict as lru cache:opt/bug
  • Loading branch information
AUTOMATIC1111 authored Sep 30, 2023
2 parents 34055f9 + 8e355fb commit cdafbca
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/sd_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down

0 comments on commit cdafbca

Please sign in to comment.