mirror of
https://github.com/deepset-ai/haystack.git
synced 2025-10-29 08:49:07 +00:00
Fix failing test (#6176)
This commit is contained in:
parent
5f35e7d04a
commit
bb295d29ee
@ -126,11 +126,7 @@ class RemoteWhisperTranscriber:
|
|||||||
|
|
||||||
for stream in streams:
|
for stream in streams:
|
||||||
file = io.BytesIO(stream.data)
|
file = io.BytesIO(stream.data)
|
||||||
try:
|
file.name = stream.metadata.get("file_path", "audio_input.wav") # default name if `file_path` not found
|
||||||
file.name = stream.metadata["file_path"]
|
|
||||||
except KeyError:
|
|
||||||
file.name = "audio_input.wav"
|
|
||||||
|
|
||||||
content = openai.Audio.transcribe(file=file, model=self.model_name, **self.whisper_params)
|
content = openai.Audio.transcribe(file=file, model=self.model_name, **self.whisper_params)
|
||||||
doc = Document(text=content["text"], metadata=stream.metadata)
|
doc = Document(text=content["text"], metadata=stream.metadata)
|
||||||
documents.append(doc)
|
documents.append(doc)
|
||||||
|
|||||||
@ -210,7 +210,6 @@ class TestRemoteWhisperTranscriber:
|
|||||||
preview_samples_path / "audio" / "this is the content of the document.wav",
|
preview_samples_path / "audio" / "this is the content of the document.wav",
|
||||||
preview_samples_path / "audio" / "the context for this answer is here.wav",
|
preview_samples_path / "audio" / "the context for this answer is here.wav",
|
||||||
preview_samples_path / "audio" / "answer.wav",
|
preview_samples_path / "audio" / "answer.wav",
|
||||||
"rb",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
audio_files = []
|
audio_files = []
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user