Skip to content

Commit 548e658

Browse files
committed
update error
1 parent d8acc79 commit 548e658

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/transformers/integrations/accelerate.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -539,9 +539,10 @@ def offload_weight(weight: torch.Tensor, weight_name: str, offload_folder: str |
539539

540540
if offload_folder is None:
541541
raise ValueError(
542-
"The current `device_map` had weights offloaded to the disk, which needed to be re-saved. This is likely "
543-
"because the model uses an internal weight format different than the one saved (i.e. most MoE models). "
544-
"Please provide an `offload_folder`for them in `from_pretrained`."
542+
"The current `device_map` had weights offloaded to the disk, which needed to be re-saved. This is either "
543+
"because the weights are not in `safetensors` format, or because the model uses an internal weight format "
544+
"different than the one saved (i.e. most MoE models). Please provide an `offload_folder`for them in "
545+
"`from_pretrained`."
545546
)
546547
# Write the weight to disk
547548
safetensor_file = os.path.join(offload_folder, f"{weight_name}.safetensors")

0 commit comments

Comments
 (0)