Commit 629b0d29 authored by sanchit-gandhi's avatar sanchit-gandhi
Browse files

fix wer

parent 589b385b
...@@ -47,7 +47,7 @@ def wer(asr_model_name_or_path, prompts, audios, device, per_device_eval_batch_s ...@@ -47,7 +47,7 @@ def wer(asr_model_name_or_path, prompts, audios, device, per_device_eval_batch_s
normalized_references = [] normalized_references = []
for pred, ref in zip(transcriptions, prompts): 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) norm_ref = normalizer(ref)
if len(norm_ref) > 0: if len(norm_ref) > 0:
norm_pred = normalizer(pred["text"]) norm_pred = normalizer(pred["text"])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment