[CI/Build] Voxtral TTS Tests (#3738)
Signed-off-by: Clodagh Walsh <clodaghwalsh17@gmail.com>
This commit is contained in:
1 parent
2fa4c7a4a9
commit
aa92a3a35d
4 files changed
+159
-2
No files matched your search
@@ -91,3 +91,90 @@ class TestVoxtralTTSFixedVoice:
|
||||
"timeout": 120.0,
|
||||
}
|
||||
)
|
||||
|
||||
@pytest.mark.advanced_model
|
||||
@pytest.mark.tts
|
||||
@hardware_test(res={"cuda": "H100"}, num_cards=1)
|
||||
def test_speech_speed(self, omni_server, openai_client) -> None:
|
||||
"""Request with speed parameters"""
|
||||
speeds = [0.5, 1, 1.5, 2, 2.5]
|
||||
for speed in speeds:
|
||||
openai_client.send_audio_speech_request(
|
||||
{
|
||||
"model": omni_server.model,
|
||||
"input": "The boy was there when the sun rose.",
|
||||
"voice": "casual_female",
|
||||
"language": "English",
|
||||
"response_format": "wav",
|
||||
"timeout": 120.0,
|
||||
"speed": speed,
|
||||
}
|
||||
)
|
||||
|
||||
@pytest.mark.advanced_model
|
||||
@pytest.mark.tts
|
||||
@hardware_test(res={"cuda": "H100"}, num_cards=1)
|
||||
def test_speech_instructions(self, omni_server, openai_client) -> None:
|
||||
"""Request with instructions parameters"""
|
||||
instructions = [
|
||||
"Speak formally",
|
||||
"Speak angrily",
|
||||
"Deliver with a sad voice",
|
||||
"Speak with a chirpy happy voice",
|
||||
]
|
||||
for instruction in instructions:
|
||||
openai_client.send_audio_speech_request(
|
||||
{
|
||||
"model": omni_server.model,
|
||||
"input": "The boy was there when the sun rose.",
|
||||
"voice": "casual_female",
|
||||
"language": "English",
|
||||
"response_format": "wav",
|
||||
"timeout": 120.0,
|
||||
"instructions": instruction,
|
||||
}
|
||||
)
|
||||
|
||||
@pytest.mark.advanced_model
|
||||
@pytest.mark.tts
|
||||
@hardware_test(res={"cuda": "H100"}, num_cards=1)
|
||||
def test_speech_response_formats(self, omni_server, openai_client) -> None:
|
||||
"""Test TTS with different response formats"""
|
||||
response_formats = ["wav", "mp3"]
|
||||
for response_format in response_formats:
|
||||
openai_client.send_audio_speech_request(
|
||||
{
|
||||
"model": omni_server.model,
|
||||
"input": "Testing various response formats.",
|
||||
"voice": "casual_male",
|
||||
"language": "English",
|
||||
"response_format": response_format,
|
||||
"timeout": 120.0,
|
||||
}
|
||||
)
|
||||
|
||||
@pytest.mark.advanced_model
|
||||
@pytest.mark.tts
|
||||
@hardware_test(res={"cuda": "H100"}, num_cards=1)
|
||||
def test_speech_batches(self, omni_server, openai_client) -> None:
|
||||
"""Test TTS batches"""
|
||||
items = [
|
||||
{"input": "The birch canoe slid on the smooth planks."},
|
||||
{"input": "Glue the sheet to the dark blue background."},
|
||||
{"input": "It's easy to tell the depth of a well."},
|
||||
{"input": "These days a chicken leg is a rare dish."},
|
||||
{"input": "Rice is often served in round bowls."},
|
||||
]
|
||||
|
||||
openai_client.send_audio_speech_batch_http_request(
|
||||
{
|
||||
"json": {
|
||||
"model": omni_server.model,
|
||||
"items": items,
|
||||
"voice": "casual_male",
|
||||
"language": "English",
|
||||
"response_format": "wav",
|
||||
},
|
||||
"timeout": 120.0,
|
||||
}
|
||||
)
|
||||
Reference in new issue
Block a user