This commit is contained in:
ZanSara 2023-09-12 16:41:08 +01:00 committed by GitHub
parent 7194343458
commit 24c42b1e03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -14,14 +14,14 @@ def test_whisper_local_transcriber(preview_samples_path):
docs = output["documents"] docs = output["documents"]
assert len(docs) == 3 assert len(docs) == 3
assert "this is the content of the document." == docs[0].content.strip().lower() assert "this is the content of the document." == docs[0].text.strip().lower()
assert preview_samples_path / "audio" / "this is the content of the document.wav" == docs[0].metadata["audio_file"] assert preview_samples_path / "audio" / "this is the content of the document.wav" == docs[0].metadata["audio_file"]
assert "the context for this answer is here." == docs[1].content.strip().lower() assert "the context for this answer is here." == docs[1].text.strip().lower()
assert ( assert (
str((preview_samples_path / "audio" / "the context for this answer is here.wav").absolute()) str((preview_samples_path / "audio" / "the context for this answer is here.wav").absolute())
== docs[1].metadata["audio_file"] == docs[1].metadata["audio_file"]
) )
assert "answer." == docs[2].content.strip().lower() assert "answer." == docs[2].text.strip().lower()
assert "<<binary stream>>" == docs[2].metadata["audio_file"] assert "<<binary stream>>" == docs[2].metadata["audio_file"]

View File

@ -22,14 +22,14 @@ def test_whisper_remote_transcriber(preview_samples_path):
docs = output["documents"] docs = output["documents"]
assert len(docs) == 3 assert len(docs) == 3
assert "this is the content of the document." == docs[0].content.strip().lower() assert "this is the content of the document." == docs[0].text.strip().lower()
assert preview_samples_path / "audio" / "this is the content of the document.wav" == docs[0].metadata["audio_file"] assert preview_samples_path / "audio" / "this is the content of the document.wav" == docs[0].metadata["audio_file"]
assert "the context for this answer is here." == docs[1].content.strip().lower() assert "the context for this answer is here." == docs[1].text.strip().lower()
assert ( assert (
str((preview_samples_path / "audio" / "the context for this answer is here.wav").absolute()) str((preview_samples_path / "audio" / "the context for this answer is here.wav").absolute())
== docs[1].metadata["audio_file"] == docs[1].metadata["audio_file"]
) )
assert "answer." == docs[2].content.strip().lower() assert "answer." == docs[2].text.strip().lower()
assert "<<binary stream>>" == docs[2].metadata["audio_file"] assert "<<binary stream>>" == docs[2].metadata["audio_file"]