fix:ollama text embedding 500 error (#8252)

This commit is contained in:
HowardChan 2024-09-11 16:23:19 +08:00 committed by GitHub
parent 75c1a82556
commit 53f37a6704
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -77,7 +77,7 @@ class OllamaEmbeddingModel(TextEmbeddingModel):
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))