Skip to content

Commit 655fbca

Browse files
committed
Update run_asr_wer method in utils_eval.py for compat with jiwer>=4.0.0
1 parent fc0fa67 commit 655fbca

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/f5_tts/eval/utils_eval.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ def run_asr_wer(args):
324324
punctuation_all = punctuation + string.punctuation
325325
wer_results = []
326326

327-
from jiwer import compute_measures
327+
from jiwer import process_words
328328

329329
for gen_wav, prompt_wav, truth in tqdm(test_set):
330330
if lang == "zh":
@@ -354,13 +354,13 @@ def run_asr_wer(args):
354354
truth = truth.lower()
355355
hypo = hypo.lower()
356356

357-
measures = compute_measures(truth, hypo)
358-
wer = measures["wer"]
357+
measures = process_words(truth, hypo)
358+
wer = measures.wer
359359

360360
# ref_list = truth.split(" ")
361-
# subs = measures["substitutions"] / len(ref_list)
362-
# dele = measures["deletions"] / len(ref_list)
363-
# inse = measures["insertions"] / len(ref_list)
361+
# subs = measures.substitutions / len(ref_list)
362+
# dele = measures.deletions / len(ref_list)
363+
# inse = measures.insertions / len(ref_list)
364364

365365
wer_results.append(
366366
{

0 commit comments

Comments
 (0)