"csrc/git@developer.sourcefind.cn:SIYIXNI/vllm.git" did not exist on "eb1816388eb08453f4b9d8be993117f72f72cd8c"
Unverified Commit 47c5c059 authored by Suraj Patil's avatar Suraj Patil Committed by GitHub
Browse files

don't load state_dict twice when using low_cpu_mem_usage in from_pretrained (#16602)

parent a2b7d19b
......@@ -1823,7 +1823,6 @@ class PreTrainedModel(nn.Module, ModuleUtilsMixin, GenerationMixin, PushToHubMix
if is_sharded:
loaded_state_dict_keys = sharded_metadata["all_checkpoint_keys"]
else:
state_dict = load_state_dict(resolved_archive_file)
loaded_state_dict_keys = [k for k in state_dict.keys()]
del state_dict # free CPU memory - will reload again later
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment