Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

save memory of extract_lora_ups_down by returning a generator instead… #24

Closed
wants to merge 2 commits into from

Conversation

Thomas-MMJ
Copy link

@Thomas-MMJ Thomas-MMJ commented Dec 13, 2022

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.

… of a list

extract_lora_ups_down currently returns a list, by returning a generator we can save some memory
@cloneofsimo
Copy link
Owner

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

@Thomas-MMJ
Copy link
Author

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.

@cloneofsimo
Copy link
Owner

Can you change this to dev branch? Thanks

@Thomas-MMJ
Copy link
Author

okay it is now PR #46

@Thomas-MMJ Thomas-MMJ closed this Dec 15, 2022
@Thomas-MMJ Thomas-MMJ deleted the patch-1 branch December 15, 2022 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants