Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to load the Whisper model for transcription.
Prompt Engineering / GenAI
import whisper model = whisper.load_model([1])
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using an invalid model name like 'fast' which does not exist.
Forgetting to put the model name in quotes.
✗ Incorrect
The 'tiny' model is the smallest Whisper model and is loaded with whisper.load_model("tiny").
2fill in blank
mediumComplete the code to transcribe audio using the Whisper model.
Prompt Engineering / GenAI
result = model.transcribe([1]) Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Passing the model object instead of the audio filename.
Passing a variable that is not the audio file path.
✗ Incorrect
The transcribe method takes the path to the audio file as a string, e.g., "audio.wav".
3fill in blank
hardFix the error in accessing the transcribed text from the result dictionary.
Prompt Engineering / GenAI
text = result[[1]] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'transcription' or 'output' as keys which do not exist.
Trying to access the result as an attribute instead of a dictionary key.
✗ Incorrect
The transcribed text is stored under the key 'text' in the result dictionary.
4fill in blank
hardFill both blanks to load the model and transcribe an audio file.
Prompt Engineering / GenAI
model = whisper.load_model([1]) result = model.transcribe([2])
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing model names and audio file names.
Using unsupported audio file formats.
✗ Incorrect
Load the 'base' model and transcribe the audio file 'audio.wav'.
5fill in blank
hardFill all three blanks to extract the transcribed text and print it.
Prompt Engineering / GenAI
model = whisper.load_model([1]) result = model.transcribe([2]) print(result[[3]])
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong keys to access the transcription.
Passing incorrect file names or model names.
✗ Incorrect
Load the 'tiny' model, transcribe 'speech.mp3', and print the 'text' key from the result.