Skip to content

Commit 6198952

Browse files
authored
Fix possible mistake when loading model to device (#57)
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)
1 parent f296bcd commit 6198952

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

whisper/transcribe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ def cli():
273273
temperature = [temperature]
274274

275275
from . import load_model
276-
model = load_model(model_name).to(device)
276+
model = load_model(model_name, device=device)
277277

278278
for audio_path in args.pop("audio"):
279279
result = transcribe(

0 commit comments

Comments
 (0)