"...git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "39c37fe45c12bc2f936313330fe5c82319adb6e3"
Unverified Commit 588d8f1f authored by Sylvain Gugger's avatar Sylvain Gugger Committed by GitHub
Browse files

Fix when Accelerate is not installed (#17518)

parent f128ccb9
......@@ -2394,7 +2394,8 @@ class PreTrainedModel(nn.Module, ModuleUtilsMixin, GenerationMixin, PushToHubMix
del state_dict
gc.collect()
save_offload_index(offload_index, offload_folder)
if offload_index is not None and len(offload_index) > 0:
save_offload_index(offload_index, offload_folder)
if offload_state_dict:
# Load back temporarily offloaded state dict
......
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