Skip to content

Commit 9310357

Browse files
rasmithRandall Smith
andauthored
[BugFix][CI/Build][ROCM] Fix import error and apply assert in appropriate case in test_struct_output_generate (#28311)
Signed-off-by: Randall Smith <ransmith@amd.com> Co-authored-by: Randall Smith <ransmith@amd.com>
1 parent 15ae8e0 commit 9310357

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

tests/v1/entrypoints/llm/test_struct_output_generate.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -677,9 +677,14 @@ def test_structured_output_with_reasoning_matrices(
677677
reasoning, content = run_reasoning_extraction(reasoner, [generated_text])
678678
print(f"Prompt: {prompt!r}\nReasoning: {reasoning!r}\nContent: {content!r}")
679679

680-
assert content is not None and reasoning is not None
681-
output_json = json.loads(content)
682-
jsonschema.validate(instance=output_json, schema=reasoning_schema)
680+
if "Qwen3" in model_name:
681+
assert content is not None
682+
683+
assert reasoning is not None
684+
685+
if content is not None:
686+
output_json = json.loads(content)
687+
jsonschema.validate(instance=output_json, schema=reasoning_schema)
683688

684689

685690
@pytest.mark.skip_global_cleanup

0 commit comments

Comments
 (0)