Skip to content

Commit

Permalink
fix: audio specific test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
csgulati09 committed May 31, 2024
1 parent fd2e53f commit fa196ea
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 21 deletions.
13 changes: 10 additions & 3 deletions tests/models.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
"image":[
"dall-e-3",
"dall-e-2"
],
"audio":[
"tts-1",
"whisper-1"
]
},
"anyscale": {
Expand All @@ -36,7 +40,8 @@
"mistralai/Mistral-7B-Instruct-v0.1",
"mistralai/Mixtral-8x7B-Instruct-v0.1"
],
"image":[]
"image":[],
"audio":[]
},
"anthropic": {
"env_variable": "ANTHROPIC_API_KEY",
Expand All @@ -53,7 +58,8 @@
"claude-2.0",
"claude-instant-1.2"
],
"image":[]
"image":[],
"audio":[]
},
"cohere": {
"env_variable": "COHERE_API_KEY",
Expand All @@ -69,6 +75,7 @@
"command",
"command-nightly"
],
"image":[]
"image":[],
"audio":[]
}
}
7 changes: 4 additions & 3 deletions tests/test_async_audio_speech.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,11 @@ def get_metadata(self):
t1_params = []
t = []
for k, v in models.items():
for i in v["chat"]:
t.append((client, k, os.environ.get(v["env_variable"]), i))
if k == "openai":
for i in v["audio"]:
t.append((client, k, os.environ.get(v["env_variable"]), i))

t1_params.extend(t)
t1_params.extend(t)

@pytest.mark.asyncio
@pytest.mark.parametrize("client, provider, auth, model", t1_params)
Expand Down
8 changes: 5 additions & 3 deletions tests/test_async_audio_transcript.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,13 @@ def get_metadata(self):
# Test-4
t4_params = []
t4 = []

for k, v in models.items():
for i in v["chat"]:
t4.append((client, k, os.environ.get(v["env_variable"]), i))
if k == "openai":
for i in v["audio"]:
t4.append((client, k, os.environ.get(v["env_variable"]), i))

t4_params.extend(t4)
t4_params.extend(t4)

@pytest.mark.asyncio
@pytest.mark.parametrize("client, provider, auth, model", t4_params)
Expand Down
7 changes: 4 additions & 3 deletions tests/test_async_audio_translation.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,11 @@ def get_metadata(self):
t4_params = []
t4 = []
for k, v in models.items():
for i in v["chat"]:
t4.append((client, k, os.environ.get(v["env_variable"]), i))
if k == "openai":
for i in v["audio"]:
t4.append((client, k, os.environ.get(v["env_variable"]), i))

t4_params.extend(t4)
t4_params.extend(t4)

@pytest.mark.asyncio
@pytest.mark.parametrize("client, provider, auth, model", t4_params)
Expand Down
7 changes: 4 additions & 3 deletions tests/test_audio_speech.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,11 @@ def get_metadata(self):
t1_params = []
t = []
for k, v in models.items():
for i in v["chat"]:
t.append((client, k, os.environ.get(v["env_variable"]), i))
if k == "openai":
for i in v["audio"]:
t.append((client, k, os.environ.get(v["env_variable"]), i))

t1_params.extend(t)
t1_params.extend(t)

@pytest.mark.parametrize("client, provider, auth, model", t1_params)
def test_method_single_with_vk_and_provider(
Expand Down
7 changes: 4 additions & 3 deletions tests/test_audio_transcript.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,11 @@ def get_metadata(self):
t4_params = []
t4 = []
for k, v in models.items():
for i in v["chat"]:
t4.append((client, k, os.environ.get(v["env_variable"]), i))
if k == "openai":
for i in v["audio"]:
t4.append((client, k, os.environ.get(v["env_variable"]), i))

t4_params.extend(t4)
t4_params.extend(t4)

@pytest.mark.parametrize("client, provider, auth, model", t4_params)
def test_method_single_with_vk_and_provider(
Expand Down
7 changes: 4 additions & 3 deletions tests/test_audio_translation.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,11 @@ def get_metadata(self):
t4_params = []
t4 = []
for k, v in models.items():
for i in v["chat"]:
t4.append((client, k, os.environ.get(v["env_variable"]), i))
if k == "openai":
for i in v["audio"]:
t4.append((client, k, os.environ.get(v["env_variable"]), i))

t4_params.extend(t4)
t4_params.extend(t4)

@pytest.mark.parametrize("client, provider, auth, model", t4_params)
def test_method_single_with_vk_and_provider(
Expand Down

0 comments on commit fa196ea

Please sign in to comment.