Skip to content

Commit

Permalink
update the logger message with accordant weights_file_name (#28181)
Browse files Browse the repository at this point in the history
Co-authored-by: yudong.lin <[email protected]>
  • Loading branch information
izyForever and yudong.lin authored Dec 22, 2023
1 parent 74d9d0c commit 68fa1e8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/transformers/modeling_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2408,7 +2408,8 @@ def save_pretrained(
save_function(shard, os.path.join(save_directory, shard_file))

if index is None:
path_to_weights = os.path.join(save_directory, _add_variant(WEIGHTS_NAME, variant))
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))
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
Expand Down

0 comments on commit 68fa1e8

Please sign in to comment.