Skip to content

Commit fd6ad32

Browse files
docs(whisper): cast input features to model dtype in AutoModel example (#49837)
openai/whisper-large-v3-turbo loads in float16 by default, while the feature extractor emits float32, so the example raised "Input type (float) and bias type (c10::Half) should be the same". Fixes #47805 Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 9b322e7 commit fd6ad32

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎docs/source/en/model_doc/whisper.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ input_features = processor(
7777
sampling_rate=audio_sample["sampling_rate"],
7878
return_tensors="pt"
7979
).input_features
80-
input_features = input_features.to(model.device)
80+
input_features = input_features.to(model.device, dtype=model.dtype)
8181

8282
predicted_ids = model.generate(input_features, cache_implementation="static")
8383
transcription = processor.batch_decode(predicted_ids, skip_special_tokens=True)

0 commit comments

Comments
 (0)