Skip to content

Commit

Permalink
ENH Float fmt in print_trainable_parameters (#1648)
Browse files Browse the repository at this point in the history
This PR replaces `trainable%: 0.5916145025956931` with `trainable%:
0.5916` as it's done already in `src/peft/mixed_model.py`.
  • Loading branch information
stas00 authored Apr 15, 2024
1 parent c8974c5 commit 56773b9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/peft/peft_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ def print_trainable_parameters(self) -> None:
trainable_params, all_param = self.get_nb_trainable_parameters()

print(
f"trainable params: {trainable_params:,d} || all params: {all_param:,d} || trainable%: {100 * trainable_params / all_param}"
f"trainable params: {trainable_params:,d} || all params: {all_param:,d} || trainable%: {100 * trainable_params / all_param:.4f}"
)

def __getattr__(self, name: str):
Expand Down

0 comments on commit 56773b9

Please sign in to comment.