Quiz Space

Deep Learning Practice · Quiz 2 · 16 Mar 2025 · January 2025 term

Question 2: Consider the following code snippet: What is the primary …

Question 2

+3 marksOne correct option

Consider the following code snippet:

python
from transformers import Wav2Vec2Processor
processor = Wav2Vec2Processor.from_pretrained("facebook/wav2vec2-large-960h")
input_values = processor("audio.wav", return_tensors="pt", sampling_rate=16000).input_values

What is the primary mistake in this code?

  1. A

    return_tensors="pt" should be return_tensors="np".

  2. B

    input_values should be extracted using .input_values[0] to match expected dimensions.

  3. C

    The sampling_rate argument should be passed during from_pretrained(), not while calling processor().

  4. D

    processor cannot process raw audio file paths, only arrays of audio samples.

Show answer

Correct answer

  • D

    processor cannot process raw audio file paths, only arrays of audio samples.

Question 2 of 19 in the IIT Madras BS Deep Learning Practice (Deep Learning Practice) Quiz 2 paper sat on 16 Mar 2025, in the January 2025 term (IIT M DEGREE AN EXAM QDB2 16 Mar 2025). It carries 3 marks.

More questions from this paper

  1. Q1Consider the following code using Wav2Vec2Processor to process an audio sample: What will the printed shape be?
  2. Q3You have a model that predicts transcriptions for audio clips. You calculate Word Error Rate (WER) using the jiwer pack…
  3. Q4What type of language modeling objective does the Whisper model use during training?
  4. Q5Why is Wav2Vec2CTCTokenizer used instead of directly using Wav2Vec2Processor for tokenization?
  5. Q6Figure question
  6. Q7Which of the following correctly describes the end-to-end ASR workflow when training a Wav2Vec2 model?
  7. Q8Which of the following statements are True?
  8. Q9You transcribed an audio recording using Whisper and applied speaker diarization. However, you notice that the transcri…
  9. Q10Consider the following Whisper transcription function: Which of the following statements are correct about this code?
  10. Q11A speaker diarization pipeline typically consists of multiple components.\ Which of the following components are essent…
  11. Q12Figure question
  12. Q13The following code snippet uses librosa to process an audio file: If audio_data.shape outputs (320000,), how long (in s…
  13. Q14Below is a snippet for loading a SpeechBrain speaker verification model: The speaker verification model uses x-vector e…
  14. Q15Consider the following 1D Convolutional Neural Network code: Based on the above data, answer the given subquestions. Wh…
  15. Q16Consider the following 1D Convolutional Neural Network code: Based on the above data, answer the given subquestions. Wh…
  16. Q17Below is a snippet for fine-tuning SpeechT5 for Text-to-Speech (TTS): Based on the above data, answer the given subques…
  17. Q18Below is a snippet for fine-tuning SpeechT5 for Text-to-Speech (TTS): Based on the above data, answer the given subques…
  18. Q19Below is a snippet for fine-tuning SpeechT5 for Text-to-Speech (TTS): Based on the above data, answer the given subques…