Skip to content

Commit

Permalink
fix:error when adding the ollama embedding model (langgenius#8236)
Browse files Browse the repository at this point in the history
Co-authored-by: crazywoola <[email protected]>
  • Loading branch information
2 people authored and cuiks committed Sep 26, 2024
1 parent 7020a72 commit adb056c
Showing 1 changed file with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,10 @@ def _invoke(
inputs.append(text)

# Prepare the payload for the request
payload = {
"input": inputs,
"model": model,
}
payload = {"input": inputs, "model": model, "options": {"use_mmap": "true"}}

# Make the request to the OpenAI API
response = requests.post(
endpoint_url, headers=headers, data=json.dumps(payload), timeout=(10, 300), 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.raise_for_status() # Raise an exception for HTTP errors
response_data = response.json()
Expand Down

0 comments on commit adb056c

Please sign in to comment.