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)
This commit is contained in:
mj-kh
2022-09-23 09:51:47 +03:30
committed by GitHub
parent f296bcd3fa
commit 61989529b7

View File

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