From e031162a6b52489bb787724fc9565d309ffe4b70 Mon Sep 17 00:00:00 2001 From: Yih-Dar <2521628+ydshieh@users.noreply.github.com> Date: Tue, 30 Mar 2021 20:26:22 +0200 Subject: [PATCH] fix md file to avoid evaluation crash (#10962) --- .../research_projects/wav2vec2/FINE_TUNE_XLSR_WAV2VEC2.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/research_projects/wav2vec2/FINE_TUNE_XLSR_WAV2VEC2.md b/examples/research_projects/wav2vec2/FINE_TUNE_XLSR_WAV2VEC2.md index 66a0f9ebf6..d8a4e11087 100644 --- a/examples/research_projects/wav2vec2/FINE_TUNE_XLSR_WAV2VEC2.md +++ b/examples/research_projects/wav2vec2/FINE_TUNE_XLSR_WAV2VEC2.md @@ -349,7 +349,7 @@ def speech_file_to_array_fn(batch): return batch test_dataset = test_dataset.map(speech_file_to_array_fn) -inputs = processor(test_dataset["speech"][:2], sampling_rate=16_000, return_tensors="pt", padding=True) +inputs = processor(test_dataset[:2]["speech"], sampling_rate=16_000, return_tensors="pt", padding=True) with torch.no_grad(): logits = model(inputs.input_values, attention_mask=inputs.attention_mask).logits @@ -357,7 +357,7 @@ with torch.no_grad(): predicted_ids = torch.argmax(logits, dim=-1) print("Prediction:", processor.batch_decode(predicted_ids)) -print("Reference:", test_dataset["sentence"][:2]) +print("Reference:", test_dataset[:2]["sentence"]) ```