소스 검색

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

Co-authored-by: crazywoola <427733928@qq.com>
tags/0.8.1
HowardChan 1 년 전
부모
커밋
82c42b9ec5
No account linked to committer's email address
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 파일 보기

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

Loading…
취소
저장