Fix: Ollama checking model exists (#2682)

This commit is contained in:
Vương Hữu Hưng (Hans)
2025-08-19 17:59:26 +07:00
committed by GitHub
parent e7013764f7
commit ff399e5528
+1 -1
View File
@@ -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):