more validation

This commit is contained in:
Dinesh Yeduguru 2024-11-18 12:11:53 -08:00
parent ccb5445d2a
commit acf9af841b
2 changed files with 37 additions and 4 deletions

View file

@ -54,3 +54,20 @@ class TestModelRegistration:
model_id="custom-model",
metadata={"llama_model": CoreModelId.llama3_1_8b_instruct.value},
)
with pytest.raises(ValueError) as exc_info:
await models_impl.register_model(
model_id="custom-model-2",
metadata={"llama_model": CoreModelId.llama3_2_3b_instruct.value},
provider_model_id="custom-model",
)
@pytest.mark.asyncio
async def test_register_with_invalid_llama_model(self, inference_stack):
_, models_impl = inference_stack
with pytest.raises(Exception) as exc_info:
await models_impl.register_model(
model_id="custom-model-2",
metadata={"llama_model": "invalid-llama-model"},
)