sakares commited on
Commit
71255c0
1 Parent(s): 428433e

fix incorrect in usage/evaluate

Browse files
Files changed (1) hide show
  1. README.md +2 -2
README.md CHANGED
@@ -59,7 +59,7 @@ def speech_file_to_array_fn(batch):
59
  batch["speech"] = resampler(speech_array).squeeze().numpy()
60
  return batch
61
 
62
- test_dataset = test_dataset.map(speech_file_to_array_fn)
63
  inputs = processor(test_dataset["speech"][:2], sampling_rate=16_000, return_tensors="pt", padding=True)
64
 
65
  with torch.no_grad():
@@ -122,7 +122,7 @@ def evaluate(batch):
122
  batch["pred_strings"] = processor.batch_decode(pred_ids)
123
  return batch
124
 
125
- result = test_dataset.map(evaluate, batched=True, batch_size=8).map(th_tokenize)
126
 
127
  print("WER: {:2f}".format(100 * wer.compute(predictions=result["pred_strings"], references=result["sentence"])))
128
  ```
 
59
  batch["speech"] = resampler(speech_array).squeeze().numpy()
60
  return batch
61
 
62
+ test_dataset = test_dataset.map(speech_file_to_array_fn).map(th_tokenize)
63
  inputs = processor(test_dataset["speech"][:2], sampling_rate=16_000, return_tensors="pt", padding=True)
64
 
65
  with torch.no_grad():
 
122
  batch["pred_strings"] = processor.batch_decode(pred_ids)
123
  return batch
124
 
125
+ result = test_dataset.map(evaluate, batched=True, batch_size=8)
126
 
127
  print("WER: {:2f}".format(100 * wer.compute(predictions=result["pred_strings"], references=result["sentence"])))
128
  ```