Skip to content

Commit f537b08

Browse files
gdhananiaclaudeyadavsahil197
authored
Add language detection test for Hindi audio transcription (#356)
* Add language detection test for Hindi audio transcription - 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 <noreply@anthropic.com> * replace url --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Sahil Yadav <yadavsahil197@gmail.com>
1 parent 92ff12e commit f537b08

File tree

1 file changed

+23
-15
lines changed

1 file changed

+23
-15
lines changed

tests/integration/resources/test_transcriptions.py

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ def test_basic_transcription_url(self, sync_together_client):
2222
"""
2323
Test basic transcription with URL audio file
2424
"""
25-
audio_url = (
26-
"https://voiptroubleshooter.com/open_speech/american/OSR_us_000_0010_8k.wav"
27-
)
25+
audio_url = "https://together-public-test-data.s3.us-west-2.amazonaws.com/audio/test_5s_clip.wav"
2826

2927
response = sync_together_client.audio.transcriptions.create(
3028
file=audio_url, model="openai/whisper-large-v3"
@@ -38,9 +36,7 @@ def test_transcription_with_language(self, sync_together_client):
3836
"""
3937
Test transcription with language parameter
4038
"""
41-
audio_url = (
42-
"https://voiptroubleshooter.com/open_speech/american/OSR_us_000_0010_8k.wav"
43-
)
39+
audio_url = "https://together-public-test-data.s3.us-west-2.amazonaws.com/audio/test_5s_clip.wav"
4440

4541
response = sync_together_client.audio.transcriptions.create(
4642
file=audio_url, model="openai/whisper-large-v3", language="en"
@@ -54,9 +50,7 @@ def test_transcription_verbose_json(self, sync_together_client):
5450
"""
5551
Test transcription with verbose JSON format and timestamps
5652
"""
57-
audio_url = (
58-
"https://voiptroubleshooter.com/open_speech/american/OSR_us_000_0010_8k.wav"
59-
)
53+
audio_url = "https://together-public-test-data.s3.us-west-2.amazonaws.com/audio/test_5s_clip.wav"
6054

6155
response = sync_together_client.audio.transcriptions.create(
6256
file=audio_url,
@@ -74,9 +68,7 @@ def test_transcription_with_temperature(self, sync_together_client):
7468
"""
7569
Test transcription with temperature parameter
7670
"""
77-
audio_url = (
78-
"https://voiptroubleshooter.com/open_speech/american/OSR_us_000_0010_8k.wav"
79-
)
71+
audio_url = "https://together-public-test-data.s3.us-west-2.amazonaws.com/audio/test_5s_clip.wav"
8072

8173
response = sync_together_client.audio.transcriptions.create(
8274
file=audio_url, model="openai/whisper-large-v3", temperature=0.2
@@ -99,12 +91,28 @@ def test_transcription_missing_model(self, sync_together_client):
9991
"""
10092
Test transcription with missing model parameter - should use default model
10193
"""
102-
audio_url = (
103-
"https://voiptroubleshooter.com/open_speech/american/OSR_us_000_0010_8k.wav"
104-
)
94+
audio_url = "https://together-public-test-data.s3.us-west-2.amazonaws.com/audio/test_5s_clip.wav"
10595

10696
response = sync_together_client.audio.transcriptions.create(file=audio_url)
10797

10898
assert isinstance(response, AudioTranscriptionResponse)
10999
assert isinstance(response.text, str)
110100
assert len(response.text) > 0
101+
102+
def test_language_detection_hindi(self, sync_together_client):
103+
"""
104+
Test language detection with Hindi audio file
105+
"""
106+
audio_url = "https://together-public-test-data.s3.us-west-2.amazonaws.com/audio/hindi_audio.wav"
107+
108+
response = sync_together_client.audio.transcriptions.create(
109+
file=audio_url,
110+
model="openai/whisper-large-v3",
111+
response_format="verbose_json",
112+
)
113+
114+
assert isinstance(response, AudioTranscriptionVerboseResponse)
115+
assert isinstance(response.text, str)
116+
assert len(response.text) > 0
117+
assert hasattr(response, "language")
118+
assert response.language == "hi"

0 commit comments

Comments
 (0)