| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Prevents slow CPU initialization of model weights on load by using accelerate `init_empty_weights`. Completely compatible with from_pretrained since weights will always be overwritten by state_dict fixes VectorSpaceLab#72
| Back | FazBrowse Home | New Git URL |
Changes
These weights are immediately overwritten when the state_dict is loaded. This means we can safely bypass initialization without consequence.
Additionally, this can achieved with no additional libraries beyond those in requirements.txt. As such, I set the default as low_cpu_mem_usage=True.
Results
From my tests, this change:
Cold Load
Hot Load
This is the first of 3 PRs I'm issuing to improve performance/fix errors. I've tried to keep each incremental change as small in scope as possible. PRs: 1. This, 2. #150, 3. #151