Fix failing test (#6176)

This commit is contained in:
Vladimir Blagojevic 2023-10-26 17:22:24 +02:00 committed by GitHub
parent 5f35e7d04a
commit bb295d29ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 6 deletions

View File

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

View File

@ -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 = []