Skip to content

Commit

Permalink
use fstring
Browse files Browse the repository at this point in the history
  • Loading branch information
Niels Rogge authored and Niels Rogge committed Dec 20, 2022
1 parent 31c8b47 commit 9ab7b76
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/transformers/models/segformer/modeling_segformer.py
Expand Up @@ -819,7 +819,7 @@ def forward(
loss = loss_fct(upsampled_logits.squeeze(1), labels.float())
loss = (loss * valid_mask).mean()
else:
raise ValueError("Number of labels should be >=0: {}".format(self.config.num_labels))
raise ValueError(f"Number of labels should be >=0: {self.config.num_labels}")

if not return_dict:
if output_hidden_states:
Expand Down

0 comments on commit 9ab7b76

Please sign in to comment.