diff --git a/examples/conformer/predict.py b/examples/conformer/predict.py index c4b8230..e89f0f6 100644 --- a/examples/conformer/predict.py +++ b/examples/conformer/predict.py @@ -160,7 +160,9 @@ def main(): ground_truth_list.append(character) logger.info("Labs (%d/%d): %s %s", count, tot_sample, uttid, ground_truth) logger.info("Hyps (%d/%d): %s %s", count, tot_sample, uttid, content) - cer = wer(content_list, ground_truth_list) + if not content_list: + raise ValueError("The Hypothesis utterance should not be empty") + cer = wer(ground_truth_list, content_list) logger.info("cer : %.3f", cer) result_file.write("{} {}\n".format(uttid, content)) result_file.flush()