Skip to content

Commit

Permalink
Fix possible mistake when loading model to device (openai#57)
Browse files Browse the repository at this point in the history
Before this change, the model is loaded into GPU regardless of the value of "device" argument in CLI.

(e.g. whisper "test.wav" --device cpu loads into GPU anyway)
  • Loading branch information
abumj authored Sep 23, 2022
1 parent f296bcd commit 6198952
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion whisper/transcribe.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def cli():
temperature = [temperature]

from . import load_model
model = load_model(model_name).to(device)
model = load_model(model_name, device=device)

for audio_path in args.pop("audio"):
result = transcribe(
Expand Down

0 comments on commit 6198952

Please sign in to comment.