Browse Source

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)
mj-kh 2 years ago
parent
commit
61989529b7
1 changed files with 1 additions and 1 deletions
  1. 1 1
      whisper/transcribe.py

+ 1 - 1
whisper/transcribe.py

@@ -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(