From 61989529b7e25762ac65c79d251d872397975db1 Mon Sep 17 00:00:00 2001 From: mj-kh <45274855+mj-kh@users.noreply.github.com> Date: Fri, 23 Sep 2022 09:51:47 +0330 Subject: [PATCH] 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) --- whisper/transcribe.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/whisper/transcribe.py b/whisper/transcribe.py index 0ee42a8..7000cfa 100644 --- a/whisper/transcribe.py +++ b/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(