mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-25 15:38:03 +00:00
refactor: standardize InferenceRouter model handling
* introduces ModelTypeError custom exception class * introduces _get_model private method in InferenceRouter class * standardizes inconsistent variable name usage for models in InferenceRouter class * removes unneeded model type check in ollama provider Signed-off-by: Nathan Weinberg <nweinber@redhat.com>
This commit is contained in:
parent
803114180b
commit
ff8942bc71
4 changed files with 28 additions and 38 deletions
|
|
@ -457,9 +457,6 @@ class OllamaInferenceAdapter(
|
|||
user: str | None = None,
|
||||
) -> OpenAIEmbeddingsResponse:
|
||||
model_obj = await self._get_model(model)
|
||||
if model_obj.model_type != ModelType.embedding:
|
||||
raise ValueError(f"Model {model} is not an embedding model")
|
||||
|
||||
if model_obj.provider_resource_id is None:
|
||||
raise ValueError(f"Model {model} has no provider_resource_id set")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue