Fix: Ollama checking model exists (#2682)
This commit is contained in:
committed by
GitHub
parent
e7013764f7
commit
ff399e5528
@@ -36,7 +36,7 @@ class OllamaEmbedding(EmbeddingBase):
|
||||
Ensure the specified model exists locally. If not, pull it from Ollama.
|
||||
"""
|
||||
local_models = self.client.list()["models"]
|
||||
if not any(model.get("name") == self.config.model for model in local_models):
|
||||
if not any(model.get("name") == self.config.model or model.get("model") == self.config.model for model in local_models):
|
||||
self.client.pull(self.config.model)
|
||||
|
||||
def embed(self, text, memory_action: Optional[Literal["add", "search", "update"]] = None):
|
||||
|
||||
Reference in New Issue
Block a user