lora icon indicating copy to clipboard operation
lora copied to clipboard

save memory of extract_lora_ups_down by returning a generator instead…

Open Thomas-MMJ opened this issue 3 years ago • 3 comments

extract_lora_ups_down currently returns a list, by returning a generator we can save some memory. With this change I less frequently get an OOM during saves.

Thomas-MMJ avatar Dec 13 '22 05:12 Thomas-MMJ

Quick question, was this be compatible with, for example, CLIs and so on?

cloneofsimo avatar Dec 13 '22 13:12 cloneofsimo

CLI? Command line interface or some other acronym? If you mean command line interface then yes. If not, then please clarify what acronym you mean. Generators are a widely used python structure, you can learn more about them here,

https://wiki.python.org/moin/Generators

They have the benefit of less memory usage and you can start consuming them while they are being created, so have shorter runtime.

Thomas-MMJ avatar Dec 13 '22 15:12 Thomas-MMJ

Can you change this to dev branch? Thanks

cloneofsimo avatar Dec 13 '22 22:12 cloneofsimo

okay it is now PR #46

Thomas-MMJ avatar Dec 15 '22 19:12 Thomas-MMJ