private-gpt
private-gpt copied to clipboard
chromadb.errors.NoIndexException: Index not found, please create an instance before querying`
llama_print_timings:
eval time = 0.00 ms / 1 runs ( 0.00 ms per run)
llama_print_timings: total time = 372.25 ms
Traceback (most recent call last):
File "/media/sreekanth/Data/PrivateGPT/privateGPT.py", line 59, in
File "/usr/local/lib/python3.10/dist-packages/langchain/chains/base.py", line 140, in call
raise e
File "/usr/local/lib/python3.10/dist-packages/langchain/chains/base.py", line 134, in call
self._call(inputs, run_manager=run_manager)
File "/usr/local/lib/python3.10/dist-packages/langchain/chains/retrieval_qa/base.py", line 119, in _call
docs = self._get_docs(question)
File "/usr/local/lib/python3.10/dist-packages/langchain/chains/retrieval_qa/base.py", line 181, in _get_docs
return self.retriever.get_relevant_documents(question)
File "/usr/local/lib/python3.10/dist-packages/langchain/vectorstores/base.py", line 366, in get_relevant_documents
docs = self.vectorstore.similarity_search(query, **self.search_kwargs)
File "/usr/local/lib/python3.10/dist-packages/langchain/vectorstores/chroma.py", line 181, in similarity_search
docs_and_scores = self.similarity_search_with_score(query, k, filter=filter)
File "/usr/local/lib/python3.10/dist-packages/langchain/vectorstores/chroma.py", line 228, in similarity_search_with_score
results = self.__query_collection(
File "/usr/local/lib/python3.10/dist-packages/langchain/utils.py", line 50, in wrapper
return func(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/langchain/vectorstores/chroma.py", line 120, in __query_collection
return self._collection.query(
File "/usr/local/lib/python3.10/dist-packages/chromadb/api/models/Collection.py", line 219, in query
return self._client._query(
File "/usr/local/lib/python3.10/dist-packages/chromadb/api/local.py", line 408, in _query
uuids, distances = self._db.get_nearest_neighbors(
File "/usr/local/lib/python3.10/dist-packages/chromadb/db/clickhouse.py", line 583, in get_nearest_neighbors
uuids, distances = index.get_nearest_neighbors(embeddings, n_results, ids)
File "/usr/local/lib/python3.10/dist-packages/chromadb/db/index/hnswlib.py", line 230, in get_nearest_neighbors
raise NoIndexException(
chromadb.errors.NoIndexException: Index not found, please create an instance before querying``
Same issue.
same issue +1
Same issue.
same issue +1
try python ingest.py
first, this should ingest the state of the union text and create an index.
already run ingest.py and created the collections and embedding files in db folder.still getting this issue
already run ingest.py and same issue too 😀
same issue
same
Same error
Here you have more context - https://gist.github.com/pancutan/8d95dbe52bf3173077a40695d1271b14
When developing LangChain integration for h2oGPT, I ran across this and other issues mentioned in this repo. One reason is because the chroma db was named differently when created vs. read later.
Try out h2oGPT if you like: https://github.com/h2oai/h2ogpt -- should be more stable w.r.t. these kind of issues.
@pseudotensor is it also possible to set up h2ogpt the same as privateGPT i.e. do document QnA locally without having any data leave the local machine?
Same issue here
@pseudotensor is it also possible to set up h2ogpt the same as privateGPT i.e. do document QnA locally without having any data leave the local machine?
Yes.
+1
Same issue here
In case anyone is blocked by this, I made a fork to add support for weavite as the vector store. Configuring the project to use weaviate works! Instructions to do this are in the docs .
System: Linux / NVIDIA GTX 1660
Error Message
Traceback (most recent call last):
File "/home/user/privateGPT/privateGPT.py", line 57, in
^^^^^^^^^
File "/home/user/.local/lib/python3.11/site-packages/langchain/chains/base.py", line 140, in call
raise e
File "/home/user/.local/lib/python3.11/site-packages/langchain/chains/base.py", line 134, in call
self._call(inputs, run_manager=run_manager)
File "/home/user/.local/lib/python3.11/site-packages/langchain/chains/retrieval_qa/base.py", line 119, in _call
docs = self._get_docs(question)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/.local/lib/python3.11/site-packages/langchain/chains/retrieval_qa/base.py", line 181, in _get_docs
return self.retriever.get_relevant_documents(question)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/.local/lib/python3.11/site-packages/langchain/vectorstores/base.py", line 366, in get_relevant_documents
docs = self.vectorstore.similarity_search(query, **self.search_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/.local/lib/python3.11/site-packages/langchain/vectorstores/chroma.py", line 181, in similarity_search
docs_and_scores = self.similarity_search_with_score(query, k, filter=filter)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/.local/lib/python3.11/site-packages/langchain/vectorstores/chroma.py", line 228, in similarity_search_with_score
results = self.__query_collection(
^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/.local/lib/python3.11/site-packages/langchain/utils.py", line 50, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/home/user/.local/lib/python3.11/site-packages/langchain/vectorstores/chroma.py", line 120, in __query_collection
return self._collection.query(
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/.local/lib/python3.11/site-packages/chromadb/api/models/Collection.py", line 219, in query
return self._client._query(
^^^^^^^^^^^^^^^^^^^^
File "/home/user/.local/lib/python3.11/site-packages/chromadb/api/local.py", line 408, in _query
uuids, distances = self._db.get_nearest_neighbors(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/.local/lib/python3.11/site-packages/chromadb/db/clickhouse.py", line 583, in get_nearest_neighbors
uuids, distances = index.get_nearest_neighbors(embeddings, n_results, ids)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/.local/lib/python3.11/site-packages/chromadb/db/index/hnswlib.py", line 230, in get_nearest_neighbors
raise NoIndexException(
chromadb.errors.NoIndexException: Index not found, please create an instance before querying
Visit the chroma-core git warehouse and find a solution in readme
https://github.com/hwchase17/langchain/issues/3011
This seems related.
Had the same issue which I fixed by running the ingestion first:
python ingest.py
This creates a db/index/
folder.
Same issue
This the way I solved it : change the SOURCE_DIRECTORY and PERSIST_DIRECTORY in constants.py correct, and run "python3 ingest.py", after that there is a index in DB directory. And then problem solved.