Skip to content

Commit

Permalink
Merge pull request #42 from g8a9/fix-logs
Browse files Browse the repository at this point in the history
Fix log printing
  • Loading branch information
emanuele-moscato authored Mar 27, 2024
2 parents 4d46242 + 282fc63 commit a8e5b1a
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ def _tmp_log_show_info(

# Note that in a single label scenario, verbose_target is ignored (always 0)

print_log(perturbation_type, perturbation_value)
print(perturbation_type, perturbation_value)
# Prediction probability
predictions = self.model_helper.predict([perturbated_audio])

Expand All @@ -561,22 +561,22 @@ def _tmp_log_show_info(
preds = self.model_helper.get_text_labels(predicted_labels)

if self.model_helper.n_labels > 1:
print_log(f"Target label: {verbose_target}")
print_log(
print(f"Target label: {verbose_target}")
print(
f"Predicted probs:",
np.round(predictions[verbose_target], 3),
)
print_log(
print(
"Predicted class: ",
preds[verbose_target],
f"id: {predicted_labels[verbose_target]}",
)
else:
print_log(
print(
f"Predicted probs: ",
np.round(predictions[0], 3),
)
print_log(
print(
"Predicted class: ",
preds,
f"id: {predicted_labels[0]}",
Expand Down

0 comments on commit a8e5b1a

Please sign in to comment.