mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-05-10 00:49:14 +08:00
fix:error when adding the ollama embedding model (#8236)
Co-authored-by: crazywoola <427733928@qq.com>
This commit is contained in:
parent
2a3d8c25bc
commit
82c42b9ec5
@ -77,15 +77,10 @@ class OllamaEmbeddingModel(TextEmbeddingModel):
|
|||||||
inputs.append(text)
|
inputs.append(text)
|
||||||
|
|
||||||
# Prepare the payload for the request
|
# Prepare the payload for the request
|
||||||
payload = {
|
payload = {"input": inputs, "model": model, "options": {"use_mmap": "true"}}
|
||||||
"input": inputs,
|
|
||||||
"model": model,
|
|
||||||
}
|
|
||||||
|
|
||||||
# Make the request to the OpenAI API
|
# Make the request to the Ollama API
|
||||||
response = requests.post(
|
response = requests.post(endpoint_url, headers=headers, data=json.dumps(payload), timeout=(10, 300))
|
||||||
endpoint_url, headers=headers, data=json.dumps(payload), timeout=(10, 300), options={"use_mmap": "true"}
|
|
||||||
)
|
|
||||||
|
|
||||||
response.raise_for_status() # Raise an exception for HTTP errors
|
response.raise_for_status() # Raise an exception for HTTP errors
|
||||||
response_data = response.json()
|
response_data = response.json()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user