Files
vllm-omni/tests/e2e/offline_inference/test_covo_audio_expansion.py
T
wangyuandamy-why-3459 4af0ddc1c2 [Test] Cleanup for helpers (#6523)
Signed-off-by: wangyu <410167048@qq.com>
Signed-off-by: [Your Name] <your.email@example.com>
Co-authored-by: amy-why-3459 <wuhaiyan17@huawei.com>
2026-08-25 09:10:17 +08:00

51 lines
1.5 KiB
Python

# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM-Omni project
"""
E2E tests for Covo-Audio-Chat model with audio input and audio/text output.
"""
import pytest
from tests.helpers.mark import hardware_test
from tests.helpers.media import generate_synthetic_audio
from tests.helpers.stage_config import get_deploy_config_path
from vllm_omni.model_executor.models.covo_audio.prompt_utils import (
COVO_AUDIO_INPUT_PREFIX,
build_covo_audio_chat_prompt,
)
models = ["tencent/Covo-Audio-Chat"]
stage_config = get_deploy_config_path("covo_audio.yaml")
test_params = [(model, stage_config, {"trust_remote_code": True}) for model in models]
def get_question():
return "请回答这段音频里的问题。"
@pytest.mark.slow
@pytest.mark.omni
@hardware_test(res={"cuda": "H100"}, num_cards={"cuda": 1})
@pytest.mark.parametrize("omni_runner", test_params, indirect=True)
def test_audio_to_audio(omni_runner, offline_client) -> None:
"""
Test audio input → text + audio output.
Deploy Setting: default yaml
Input Modal: text + audio
Output Modal: audio
"""
audio = generate_synthetic_audio(2, 1, 16000)["np_array"]
if len(audio.shape) == 2:
audio = audio.squeeze()
user_content = COVO_AUDIO_INPUT_PREFIX + get_question()
prompt = build_covo_audio_chat_prompt(user_content)
request_config = {
"prompts": prompt,
"audios": (audio, 16000),
"modalities": ["audio"],
}
offline_client.send_omni_request(request_config)