raghav
raghav

Reputation: 11

I keep getting this value error when creating Ollama Embedding

enter image description here

Error:ValueError: Error raised by inference endpoint: HTTPConnectionPool(host='localhost', port=11434): Max retries exceeded with url: /api/embeddings (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x29d6fc070>: Failed to establish a new connection: [Errno 61] Connection refused'))

I tried this code:

#Using OllamaEmbeddings
from langchain_community.embeddings import OllamaEmbeddings

embedding_function = OllamaEmbeddings()
db = Chroma.from_documents(chunks,  embedding_function, persist_directory='/Users/raghavjeendgar/Downloads/embeddings/OllamaEmbeddings')
db.persist()

Upvotes: 1

Views: 944

Answers (1)

Urvesh
Urvesh

Reputation: 435

I would suggest you to run the application in the docker file. And Try running the application using BASE_URL: http://host.docker.internal:11434.

Upvotes: 0

Related Questions