Fix: Ollama checking model exists (#2682)
This commit is contained in:
@@ -36,7 +36,7 @@ class OllamaEmbedding(EmbeddingBase):
|
|||||||
Ensure the specified model exists locally. If not, pull it from Ollama.
|
Ensure the specified model exists locally. If not, pull it from Ollama.
|
||||||
"""
|
"""
|
||||||
local_models = self.client.list()["models"]
|
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)
|
self.client.pull(self.config.model)
|
||||||
|
|
||||||
def embed(self, text, memory_action: Optional[Literal["add", "search", "update"]] = None):
|
def embed(self, text, memory_action: Optional[Literal["add", "search", "update"]] = None):
|
||||||
|
|||||||
Reference in New Issue
Block a user