fix: corrected misleading log message in save_pretrained function (#28699)

This commit is contained in:
Turetskii Mikhail 2024-01-26 14:52:53 +03:00 committed by GitHub
parent bbe30c6968
commit 1f47a24aa1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2495,8 +2495,7 @@ class PreTrainedModel(nn.Module, ModuleUtilsMixin, GenerationMixin, PushToHubMix
save_function(shard, os.path.join(save_directory, shard_file))
if index is None:
weights_file_name = SAFE_WEIGHTS_NAME if safe_serialization else WEIGHTS_NAME
path_to_weights = os.path.join(save_directory, _add_variant(weights_file_name, variant))
path_to_weights = os.path.join(save_directory, weights_name)
logger.info(f"Model weights saved in {path_to_weights}")
else:
save_index_file = SAFE_WEIGHTS_INDEX_NAME if safe_serialization else WEIGHTS_INDEX_NAME