Skip to content

Commit

Permalink
fix wer
Browse files Browse the repository at this point in the history
  • Loading branch information
sanchit-gandhi committed May 30, 2024
1 parent 589b385 commit 629b0d2
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 629b0d2

Please sign in to comment.