mirror of
https://github.com/deepset-ai/haystack.git
synced 2025-10-28 16:28:47 +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:
|
||||
file = io.BytesIO(stream.data)
|
||||
try:
|
||||
file.name = stream.metadata["file_path"]
|
||||
except KeyError:
|
||||
file.name = "audio_input.wav"
|
||||
|
||||
file.name = stream.metadata.get("file_path", "audio_input.wav") # default name if `file_path` not found
|
||||
content = openai.Audio.transcribe(file=file, model=self.model_name, **self.whisper_params)
|
||||
doc = Document(text=content["text"], metadata=stream.metadata)
|
||||
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" / "the context for this answer is here.wav",
|
||||
preview_samples_path / "audio" / "answer.wav",
|
||||
"rb",
|
||||
]
|
||||
|
||||
audio_files = []
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user