From b2067afcebc93c2aa0308b798ae802001ccda4f1 Mon Sep 17 00:00:00 2001 From: Garima Dhanania Date: Thu, 14 Aug 2025 13:36:21 -0700 Subject: [PATCH 1/2] Add language detection test for Hindi audio transcription MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Added test_language_detection_hindi() to verify language detection functionality - Uses Hindi audio file OSR_in_000_0062_16k.wav from voiptroubleshooter.com - Validates that whisper-large-v3 correctly identifies Hindi language as "hi" - Test uses verbose_json format to access language metadata 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .../resources/test_transcriptions.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/integration/resources/test_transcriptions.py b/tests/integration/resources/test_transcriptions.py index 0b87150..f9ba62b 100644 --- a/tests/integration/resources/test_transcriptions.py +++ b/tests/integration/resources/test_transcriptions.py @@ -108,3 +108,21 @@ def test_transcription_missing_model(self, sync_together_client): assert isinstance(response, AudioTranscriptionResponse) assert isinstance(response.text, str) assert len(response.text) > 0 + + def test_language_detection_hindi(self, sync_together_client): + """ + Test language detection with Hindi audio file + """ + audio_url = ( + "https://voiptroubleshooter.com/open_speech/hindi/OSR_in_000_0062_16k.wav" + ) + + response = sync_together_client.audio.transcriptions.create( + file=audio_url, model="openai/whisper-large-v3", response_format="verbose_json" + ) + + assert isinstance(response, AudioTranscriptionVerboseResponse) + assert isinstance(response.text, str) + assert len(response.text) > 0 + assert hasattr(response, "language") + assert response.language == "hi" From 090fdaf7e5bd7f4fca04f0fd1bfd22780850da32 Mon Sep 17 00:00:00 2001 From: Sahil Yadav Date: Thu, 14 Aug 2025 17:44:17 -0700 Subject: [PATCH 2/2] replace url --- .../resources/test_transcriptions.py | 28 ++++++------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/tests/integration/resources/test_transcriptions.py b/tests/integration/resources/test_transcriptions.py index f9ba62b..3852ebe 100644 --- a/tests/integration/resources/test_transcriptions.py +++ b/tests/integration/resources/test_transcriptions.py @@ -22,9 +22,7 @@ def test_basic_transcription_url(self, sync_together_client): """ Test basic transcription with URL audio file """ - audio_url = ( - "https://voiptroubleshooter.com/open_speech/american/OSR_us_000_0010_8k.wav" - ) + audio_url = "https://together-public-test-data.s3.us-west-2.amazonaws.com/audio/test_5s_clip.wav" response = sync_together_client.audio.transcriptions.create( file=audio_url, model="openai/whisper-large-v3" @@ -38,9 +36,7 @@ def test_transcription_with_language(self, sync_together_client): """ Test transcription with language parameter """ - audio_url = ( - "https://voiptroubleshooter.com/open_speech/american/OSR_us_000_0010_8k.wav" - ) + audio_url = "https://together-public-test-data.s3.us-west-2.amazonaws.com/audio/test_5s_clip.wav" response = sync_together_client.audio.transcriptions.create( file=audio_url, model="openai/whisper-large-v3", language="en" @@ -54,9 +50,7 @@ def test_transcription_verbose_json(self, sync_together_client): """ Test transcription with verbose JSON format and timestamps """ - audio_url = ( - "https://voiptroubleshooter.com/open_speech/american/OSR_us_000_0010_8k.wav" - ) + audio_url = "https://together-public-test-data.s3.us-west-2.amazonaws.com/audio/test_5s_clip.wav" response = sync_together_client.audio.transcriptions.create( file=audio_url, @@ -74,9 +68,7 @@ def test_transcription_with_temperature(self, sync_together_client): """ Test transcription with temperature parameter """ - audio_url = ( - "https://voiptroubleshooter.com/open_speech/american/OSR_us_000_0010_8k.wav" - ) + audio_url = "https://together-public-test-data.s3.us-west-2.amazonaws.com/audio/test_5s_clip.wav" response = sync_together_client.audio.transcriptions.create( file=audio_url, model="openai/whisper-large-v3", temperature=0.2 @@ -99,9 +91,7 @@ def test_transcription_missing_model(self, sync_together_client): """ Test transcription with missing model parameter - should use default model """ - audio_url = ( - "https://voiptroubleshooter.com/open_speech/american/OSR_us_000_0010_8k.wav" - ) + audio_url = "https://together-public-test-data.s3.us-west-2.amazonaws.com/audio/test_5s_clip.wav" response = sync_together_client.audio.transcriptions.create(file=audio_url) @@ -113,12 +103,12 @@ def test_language_detection_hindi(self, sync_together_client): """ Test language detection with Hindi audio file """ - audio_url = ( - "https://voiptroubleshooter.com/open_speech/hindi/OSR_in_000_0062_16k.wav" - ) + audio_url = "https://together-public-test-data.s3.us-west-2.amazonaws.com/audio/hindi_audio.wav" response = sync_together_client.audio.transcriptions.create( - file=audio_url, model="openai/whisper-large-v3", response_format="verbose_json" + file=audio_url, + model="openai/whisper-large-v3", + response_format="verbose_json", ) assert isinstance(response, AudioTranscriptionVerboseResponse)