From a27d4d58ec4cd89d9f49c905ebb14af9c7e4b856 Mon Sep 17 00:00:00 2001 From: crazywoola <100913391+crazywoola@users.noreply.github.com> Date: Mon, 9 Sep 2024 15:27:49 +0800 Subject: [PATCH] fix: ollama text embedding 500 error (#8131) --- .../model_providers/ollama/text_embedding/text_embedding.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/core/model_runtime/model_providers/ollama/text_embedding/text_embedding.py b/api/core/model_runtime/model_providers/ollama/text_embedding/text_embedding.py index 9e26d35afc..8f7d54c516 100644 --- a/api/core/model_runtime/model_providers/ollama/text_embedding/text_embedding.py +++ b/api/core/model_runtime/model_providers/ollama/text_embedding/text_embedding.py @@ -89,7 +89,8 @@ class OllamaEmbeddingModel(TextEmbeddingModel): endpoint_url, headers=headers, data=json.dumps(payload), - timeout=(10, 300) + timeout=(10, 300), + options={"use_mmap": "true"} ) response.raise_for_status() # Raise an exception for HTTP errors