Skip to content

Commit

Permalink
Merge pull request #61 from sanchit-gandhi/eval-fix
Browse files Browse the repository at this point in the history
[eval] fix trigger for english normaliser
  • Loading branch information
sanchit-gandhi authored May 30, 2024
2 parents 589b385 + 629b0d2 commit 8b8c576
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion training/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def wer(asr_model_name_or_path, prompts, audios, device, per_device_eval_batch_s
normalized_references = []

for pred, ref in zip(transcriptions, prompts):
normalizer = english_normalizer if hasattr(pred, "language") and pred["language"] == "english" else basic_normalizer
normalizer = english_normalizer if return_language and pred["chunks"][0]["language"] == "english" else basic_normalizer
norm_ref = normalizer(ref)
if len(norm_ref) > 0:
norm_pred = normalizer(pred["text"])
Expand Down

0 comments on commit 8b8c576

Please sign in to comment.