Skip to content

Commit

Permalink
fix th_accuracy when th_accuracy is misssing (#2541)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mddct authored May 28, 2024
1 parent 096dad9 commit 9c68e78
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion wenet/utils/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def cv(self, model, cv_data_loader, configs):

num_seen_utts += num_utts
total_acc.append(_dict['th_accuracy'].item(
) if _dict['th_accuracy'] is not None else 0.0)
) if _dict.get('th_accuracy', None) is not None else 0.0)
for loss_name, loss_value in _dict.items():
if loss_value is not None and "loss" in loss_name \
and torch.isfinite(loss_value):
Expand Down

0 comments on commit 9c68e78

Please sign in to comment.