[Bugfix][Model] Validate DefaultModelLoader / LoadConfig and fail with clear errors (#45196)

Signed-off-by: Ting Sun <suntcrick@gmail.com>
This commit is contained in:
Ting SUN
2026-06-17 21:46:33 +00:00
committed by GitHub
parent 58b2e89642
commit 9d4b87f4f0
5 changed files with 108 additions and 7 deletions
+11
View File
@@ -1557,3 +1557,14 @@ def test_ir_op_priority_ctx():
# context restored even after exception
assert ir.ops.rms_norm.get_priority() == ["vllm_c", "native"]
assert ir.ops.fused_add_rms_norm.get_priority() == ["native"]
def test_load_config_rejects_invalid_safetensors_load_strategy():
with pytest.raises(pydantic.ValidationError):
LoadConfig(safetensors_load_strategy="not_a_real_strategy")
@pytest.mark.parametrize("bad_load_format", [None, 123])
def test_load_config_rejects_non_string_load_format(bad_load_format):
with pytest.raises(pydantic.ValidationError):
LoadConfig(load_format=bad_load_format)