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