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,6 +2394,7 @@ class PreTrainedModel(nn.Module, ModuleUtilsMixin, GenerationMixin, PushToHubMix
del state_dict
gc.collect()
if offload_index is not None and len(offload_index) > 0:
save_offload_index(offload_index, offload_folder)
if offload_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