Migrate audiox examples (#4607)
Signed-off-by: zzehli <jaeli_ottawa@outlook.com>
This commit is contained in:
11 files changed
+335
-227
No files matched your search
@@ -39,7 +39,13 @@ def _audiox_server_cases(model: str):
|
||||
@pytest.mark.diffusion
|
||||
@pytest.mark.parametrize("omni_server", _audiox_server_cases(AUDIOX_TEST_MODEL), indirect=True)
|
||||
def test_audiox_t2a_online(omni_server: OmniServer, openai_client: OpenAIClientHandler) -> None:
|
||||
"""AudioX text-to-audio: chat completion returns a non-empty WAV in `message.audio.data`."""
|
||||
"""AudioX text-to-audio: chat completion returns a non-empty WAV in `message.audio.data`.
|
||||
|
||||
AudioX is registered in ``vllm_omni/model_extras`` (``AudioXPipeline``), so the
|
||||
``audiox_task`` / ``seconds_*`` / ``sigma_*`` keys below flow through the standard
|
||||
``apply_declared_extra_args`` server path into ``sampling_params.extra_args`` rather
|
||||
than the old top-level ``extra_args`` escape hatch.
|
||||
"""
|
||||
request_config = {
|
||||
"model": omni_server.model,
|
||||
"messages": dummy_messages_from_mix_data(content_text=T2A_PROMPT),
|
||||
@@ -50,6 +56,8 @@ def test_audiox_t2a_online(omni_server: OmniServer, openai_client: OpenAIClientH
|
||||
"audiox_task": "t2a",
|
||||
"seconds_start": 0.0,
|
||||
"seconds_total": 2.0,
|
||||
"sigma_min": 0.03,
|
||||
"sigma_max": 1000.0,
|
||||
},
|
||||
}
|
||||
openai_client.send_diffusion_request(request_config)
|
||||
@@ -147,6 +147,47 @@ def test_cosmos3_text_to_image_prompt_builder_selects_image_modality() -> None:
|
||||
) == {"prompt": "a red sports car", "modalities": ["image"]}
|
||||
|
||||
|
||||
@pytest.mark.core_model
|
||||
@pytest.mark.cpu
|
||||
def test_audiox_extra_registry_declares_request_and_response_params() -> None:
|
||||
assert get_extra_body_params("AudioXPipeline") == frozenset(
|
||||
{
|
||||
"audiox_task",
|
||||
"seconds_start",
|
||||
"seconds_total",
|
||||
"sigma_min",
|
||||
"sigma_max",
|
||||
"cfg_rescale",
|
||||
"video_path",
|
||||
"audio_path",
|
||||
}
|
||||
)
|
||||
assert get_extra_output_params("AudioXPipeline") == frozenset({"audiox_task"})
|
||||
assert should_init_extra_args_for_non_diffusion_stages("AudioXPipeline") is False
|
||||
|
||||
|
||||
@pytest.mark.core_model
|
||||
@pytest.mark.cpu
|
||||
def test_audiox_declared_extra_args_route_into_sampling_params() -> None:
|
||||
params = OmniDiffusionSamplingParams()
|
||||
declared = get_extra_body_params("AudioXPipeline")
|
||||
apply_declared_extra_args(
|
||||
params,
|
||||
declared,
|
||||
{
|
||||
"audiox_task": "t2a",
|
||||
"seconds_total": 10.0,
|
||||
"sigma_min": 0.03,
|
||||
"unknown": "ignored",
|
||||
},
|
||||
)
|
||||
assert params.extra_args == {
|
||||
"audiox_task": "t2a",
|
||||
"seconds_total": 10.0,
|
||||
"sigma_min": 0.03,
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.core_model
|
||||
@pytest.mark.cpu
|
||||
def test_helios_extra_registry_declares_request_and_response_params() -> None:
|
||||
|
||||
Reference in new issue
Block a user