gpt-fast
gpt-fast copied to clipboard
Optimized the process of loading PyTorch state dictionaries, merging …
…them and remapping their keys
Integrating loading, merging, and remapping into one step reduces the overall processing time by minimizing redundant operations. Pre-compiling the regular expression used for identifying and transforming layer-related keys cuts down the processing time required for these operations. By directly updating the final results without an intermediate merged dictionary, the memory footprint is reduced.