[Test] Add long text output correctness test for Qwen3-Omni (#3539)
Signed-off-by: ZeldaHuang <hzm414167@alibaba-inc.com> Signed-off-by: tzhouam <tzhouam@connect.ust.hk> Co-authored-by: tzhouam <tzhouam@connect.ust.hk>
This commit is contained in:
1 parent
5c3c81920b
commit
220ce0b4ea
6 files changed
+34
-6
No files matched your search
@@ -477,6 +477,7 @@ def assert_omni_response(response: Any, request_config: dict[str, Any], run_leve
|
||||
# Verify similarity (Whisper transcript vs streamed/detokenized text)
|
||||
if "audio" in modalities:
|
||||
audio_ref_text = request_config.get("audio_ref_text")
|
||||
similarity_threshold = request_config.get("similarity_threshold", 0.8)
|
||||
if "text" in modalities:
|
||||
transcript = (response.audio_content or "").strip()
|
||||
text_output = (response.text_content or "").strip()
|
||||
@@ -484,14 +485,14 @@ def assert_omni_response(response: Any, request_config: dict[str, Any], run_leve
|
||||
transcript.lower(),
|
||||
text_output.lower(),
|
||||
)
|
||||
assert similarity > 0.9, "The audio content is not same as the text"
|
||||
print(f"similarity is: {similarity}")
|
||||
assert similarity > similarity_threshold, "The audio content is not same as the text"
|
||||
if audio_ref_text:
|
||||
audio_similarity = cosine_similarity_text(
|
||||
response.audio_content.lower(),
|
||||
str(audio_ref_text).lower(),
|
||||
)
|
||||
assert audio_similarity > 0.9, (
|
||||
assert audio_similarity > similarity_threshold, (
|
||||
f"The audio content does not match reference text: similarity={audio_similarity:.3f}"
|
||||
)
|
||||
|
||||
|
||||
Reference in new issue
Block a user