mirror of
https://github.com/deepset-ai/haystack.git
synced 2025-11-02 02:39:51 +00:00
fix remote whisper tests (#5732)
This commit is contained in:
parent
42b6954aa5
commit
7abd73419f
@ -4,13 +4,14 @@ from haystack.preview.components.audio.whisper_local import LocalWhisperTranscri
|
||||
def test_whisper_local_transcriber(preview_samples_path):
|
||||
comp = LocalWhisperTranscriber(model_name_or_path="medium")
|
||||
comp.warm_up()
|
||||
docs = comp.transcribe(
|
||||
output = comp.run(
|
||||
audio_files=[
|
||||
preview_samples_path / "audio" / "this is the content of the document.wav",
|
||||
str((preview_samples_path / "audio" / "the context for this answer is here.wav").absolute()),
|
||||
open(preview_samples_path / "audio" / "answer.wav", "rb"),
|
||||
]
|
||||
)
|
||||
docs = output["documents"]
|
||||
assert len(docs) == 3
|
||||
|
||||
assert "this is the content of the document." == docs[0].content.strip().lower()
|
||||
|
||||
@ -13,15 +13,13 @@ def test_whisper_remote_transcriber(preview_samples_path):
|
||||
comp = RemoteWhisperTranscriber(api_key=os.environ.get("OPENAI_API_KEY"))
|
||||
|
||||
output = comp.run(
|
||||
RemoteWhisperTranscriber.Input(
|
||||
audio_files=[
|
||||
preview_samples_path / "audio" / "this is the content of the document.wav",
|
||||
str((preview_samples_path / "audio" / "the context for this answer is here.wav").absolute()),
|
||||
open(preview_samples_path / "audio" / "answer.wav", "rb"),
|
||||
]
|
||||
)
|
||||
audio_files=[
|
||||
preview_samples_path / "audio" / "this is the content of the document.wav",
|
||||
str((preview_samples_path / "audio" / "the context for this answer is here.wav").absolute()),
|
||||
open(preview_samples_path / "audio" / "answer.wav", "rb"),
|
||||
]
|
||||
)
|
||||
docs = output.documents
|
||||
docs = output["documents"]
|
||||
assert len(docs) == 3
|
||||
|
||||
assert "this is the content of the document." == docs[0].content.strip().lower()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user