Num parameters in model.safetensors.index.json (#38531)
Some checks are pending
Self-hosted runner (benchmark) / Benchmark (aws-g5-4xlarge-cache) (push) Waiting to run
Build documentation / build (push) Waiting to run
New model PR merged notification / Notify new model (push) Waiting to run
Slow tests on important models (on Push - A10) / Get all modified files (push) Waiting to run
Slow tests on important models (on Push - A10) / Slow & FA2 tests (push) Blocked by required conditions
Self-hosted runner (push-caller) / Check if setup was changed (push) Waiting to run
Self-hosted runner (push-caller) / build-docker-containers (push) Blocked by required conditions
Self-hosted runner (push-caller) / Trigger Push CI (push) Blocked by required conditions
Secret Leaks / trufflehog (push) Waiting to run
Update Transformers metadata / build_and_package (push) Waiting to run

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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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