From a46c6f999a5f8a64295aae11ad3d6b2320a89143 Mon Sep 17 00:00:00 2001 From: crazywoola <427733928@qq.com> Date: Wed, 11 Sep 2024 10:15:41 +0800 Subject: [PATCH] fix: lint --- .../ollama/text_embedding/text_embedding.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) 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 127c991a103590..ffa9ea2f90791f 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 @@ -77,18 +77,10 @@ def _invoke( inputs.append(text) # Prepare the payload for the request - payload = { - "input": inputs, - "model": model, - "options": { - "use_mmap": True - } - } + payload = {"input": inputs, "model": model, "options": {"use_mmap": "true"}} # Make the request to the Ollama API - response = requests.post( - endpoint_url, headers=headers, data=json.dumps(payload), timeout=(10, 300) - ) + response = requests.post(endpoint_url, headers=headers, data=json.dumps(payload), timeout=(10, 300)) response.raise_for_status() # Raise an exception for HTTP errors response_data = response.json()