cahya commited on
Commit
3c61c77
1 Parent(s): a542f83

fixed the dataset reading

Browse files

test_dataset["speech"][:2] -> test_dataset[:2]["speech"]

Files changed (1) hide show
  1. README.md +2 -2
README.md CHANGED
@@ -56,7 +56,7 @@ def speech_file_to_array_fn(batch):
56
  return batch
57
 
58
  test_dataset = test_dataset.map(speech_file_to_array_fn)
59
- inputs = processor(test_dataset["speech"][:2], sampling_rate=16_000, return_tensors="pt", padding=True)
60
 
61
  with torch.no_grad():
62
  logits = model(inputs.input_values, attention_mask=inputs.attention_mask).logits
@@ -64,7 +64,7 @@ with torch.no_grad():
64
  predicted_ids = torch.argmax(logits, dim=-1)
65
 
66
  print("Prediction:", processor.batch_decode(predicted_ids))
67
- print("Reference:", test_dataset["sentence"][:2])
68
  ```
69
 
70
 
56
  return batch
57
 
58
  test_dataset = test_dataset.map(speech_file_to_array_fn)
59
+ inputs = processor(test_dataset[:2]["speech"], sampling_rate=16_000, return_tensors="pt", padding=True)
60
 
61
  with torch.no_grad():
62
  logits = model(inputs.input_values, attention_mask=inputs.attention_mask).logits
64
  predicted_ids = torch.argmax(logits, dim=-1)
65
 
66
  print("Prediction:", processor.batch_decode(predicted_ids))
67
+ print("Reference:", test_dataset[:2]["sentence"])
68
  ```
69
 
70