Skip to content

Commit

Permalink
fix: whisper tests using audio file from our github repo (#8454)
Browse files Browse the repository at this point in the history
* adding audio file

* temporary removing failing test

* removing failing test
  • Loading branch information
davidsbatista authored Oct 14, 2024
1 parent e7bfd80 commit a50593e
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 37 deletions.
17 changes: 0 additions & 17 deletions test/components/audio/test_whisper_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,20 +204,3 @@ def test_whisper_local_transcriber(self, test_files_path):
assert docs[2].content.strip().lower() == "answer."
# meta.audio_file should contain the temp path where we dumped the audio bytes
assert docs[2].meta["audio_file"]

@pytest.mark.integration
@pytest.mark.skipif(sys.platform in ["win32", "cygwin"], reason="ffmpeg not installed on Windows CI")
def test_whisper_local_transcriber_pipeline_and_url_source(self):
pipe = Pipeline()
pipe.add_component("fetcher", LinkContentFetcher())
pipe.add_component("transcriber", LocalWhisperTranscriber(model="tiny"))

pipe.connect("fetcher", "transcriber")
result = pipe.run(
data={
"fetcher": {
"urls": ["https://ia903102.us.archive.org/19/items/100-Best--Speeches/EK_19690725_64kb.mp3"]
}
}
)
assert "Massachusetts" in result["transcriber"]["documents"][0].content
20 changes: 0 additions & 20 deletions test/components/audio/test_whisper_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,23 +189,3 @@ def test_whisper_remote_transcriber(self, test_files_path):
assert str(test_files_path / "audio" / "the context for this answer is here.wav") == docs[1].meta["file_path"]

assert docs[2].content.strip().lower() == "answer."

@pytest.mark.skipif(
not os.environ.get("OPENAI_API_KEY", None),
reason="Export an env var called OPENAI_API_KEY containing the OpenAI API key to run this test.",
)
@pytest.mark.integration
def test_whisper_remote_transcriber_pipeline_and_url_source(self):
pipe = Pipeline()
pipe.add_component("fetcher", LinkContentFetcher())
pipe.add_component("transcriber", RemoteWhisperTranscriber())

pipe.connect("fetcher", "transcriber")
result = pipe.run(
data={
"fetcher": {
"urls": ["https://ia903102.us.archive.org/19/items/100-Best--Speeches/EK_19690725_64kb.mp3"]
}
}
)
assert "Massachusetts" in result["transcriber"]["documents"][0].content
Binary file added test/test_files/audio/MLK_Something_happening.mp3
Binary file not shown.

0 comments on commit a50593e

Please sign in to comment.