瀏覽代碼

fix:error when adding the ollama embedding model (#8236)

Co-authored-by: crazywoola <427733928@qq.com>
tags/0.8.1
HowardChan 1 年之前
父節點
當前提交
82c42b9ec5
沒有連結到貢獻者的電子郵件帳戶。
共有 1 個檔案被更改,包括 3 行新增8 行删除
  1. 3
    8
      api/core/model_runtime/model_providers/ollama/text_embedding/text_embedding.py

+ 3
- 8
api/core/model_runtime/model_providers/ollama/text_embedding/text_embedding.py 查看文件

inputs.append(text) inputs.append(text)


# Prepare the payload for the request # 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.raise_for_status() # Raise an exception for HTTP errors
response_data = response.json() response_data = response.json()

Loading…
取消
儲存