mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-10-04 20:14:13 +00:00
ensure embedding models have dimensions
This commit is contained in:
parent
2a478fb1d5
commit
27a6918834
2 changed files with 24 additions and 4 deletions
|
@ -35,6 +35,11 @@ class ProviderModelEntry(BaseModel):
|
|||
llama_model: str | None = None
|
||||
model_type: ModelType = ModelType.llm
|
||||
metadata: dict[str, Any] = Field(default_factory=dict)
|
||||
|
||||
def __init__(self, **data):
|
||||
super().__init__(**data)
|
||||
if self.model_type == ModelType.embedding and "embedding_dimension" not in self.metadata:
|
||||
raise ValueError("Embedding models must specify 'embedding_dimension' in metadata")
|
||||
|
||||
|
||||
def get_huggingface_repo(model_descriptor: str) -> str | None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue