From 629b0d2908e789ce0c57f58da3ec5d51e6fa95ac Mon Sep 17 00:00:00 2001 From: sanchit-gandhi Date: Thu, 30 May 2024 11:30:22 +0100 Subject: [PATCH] fix wer --- training/eval.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/training/eval.py b/training/eval.py index 0fed444..572cf55 100644 --- a/training/eval.py +++ b/training/eval.py @@ -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"])