akki2825 commited on
Commit
613c9f7
·
verified ·
1 Parent(s): 43380b2

change readlines

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -120,8 +120,11 @@ def format_sentence_metrics(sentence_wers, sentence_cers, average_wer, average_c
120
 
121
  def process_files(reference_file, hypothesis_file):
122
  try:
123
- reference_text = reference_file.read().decode("utf-8").splitlines()
124
- hypothesis_text = hypothesis_file.read().decode("utf-8").splitlines()
 
 
 
125
 
126
  overall_wer = calculate_wer(reference_text, hypothesis_text)
127
  overall_cer = calculate_cer(reference_text, hypothesis_text)
 
120
 
121
  def process_files(reference_file, hypothesis_file):
122
  try:
123
+ with open(reference_file.name, 'r', encoding='utf-8') as f:
124
+ reference_text = f.read().splitlines()
125
+
126
+ with open(hypothesis_file.name, 'r', encoding='utf-8') as f:
127
+ hypothesis_text = f.read().splitlines()
128
 
129
  overall_wer = calculate_wer(reference_text, hypothesis_text)
130
  overall_cer = calculate_cer(reference_text, hypothesis_text)