Num parameters in model.safetensors.index.json (#38531)

Num parameters in index.json
This commit is contained in:
Lysandre Debut
2025-06-02 17:16:31 +02:00
committed by GitHub
parent cceab972ba
commit afb35a10ed

View File

@@ -3750,7 +3750,7 @@ class PreTrainedModel(nn.Module, ModuleUtilsMixin, PushToHubMixin, PeftAdapterMi
index = None index = None
if state_dict_split.is_sharded: if state_dict_split.is_sharded:
index = { index = {
"metadata": state_dict_split.metadata, "metadata": {"total_parameters": self.num_parameters(), **state_dict_split.metadata},
"weight_map": state_dict_split.tensor_to_filename, "weight_map": state_dict_split.tensor_to_filename,
} }