specify CPU device in warm_up test (#7014)

This commit is contained in:
Stefano Fiorucci 2024-02-16 13:01:57 +01:00 committed by GitHub
parent b552b0b37c
commit 44b5ae291c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -71,7 +71,7 @@ class TestLocalWhisperTranscriber:
def test_warmup(self):
with patch("haystack.components.audio.whisper_local.whisper") as mocked_whisper:
transcriber = LocalWhisperTranscriber(model="large-v2")
transcriber = LocalWhisperTranscriber(model="large-v2", device=ComponentDevice.from_str("cpu"))
mocked_whisper.load_model.assert_not_called()
transcriber.warm_up()
mocked_whisper.load_model.assert_called_once_with("large-v2", device=torch.device(type="cpu"))