Skip to content

Commit

Permalink
Adds audio translation test
Browse files Browse the repository at this point in the history
  • Loading branch information
CollectiveUnicorn committed Jul 3, 2024
1 parent 20a2171 commit 0b2fe7b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Binary file added tests/data/arabic-audio.wav
Binary file not shown.
9 changes: 9 additions & 0 deletions tests/e2e/test_whisper.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,12 @@ def test_transcriptions():

assert len(transcription.text) > 0 # The transcription should not be empty
assert len(transcription.text) < 500 # The transcription should not be too long


def test_translations():
translation = client.audio.translations.create(
model="whisper", file=Path("tests/data/arabic-audio.wav")
)

assert len(translation.text) > 0 # The translation should not be empty
assert len(translation.text) < 500 # The translation should not be too long

0 comments on commit 0b2fe7b

Please sign in to comment.