private-gpt: 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 <module>
main()
File “/media/sreekanth/Data/PrivateGPT/privateGPT.py”, line 44, in main
res = qa(query)
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``
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 3
- Comments: 23
Visit the chroma-core git warehouse and find a solution in readme
+1
Had the same issue which I fixed by running the ingestion first:
python ingest.py
This creates a
db/index/
folder.https://github.com/hwchase17/langchain/issues/3011
This seems related.
System: Linux / NVIDIA GTX 1660 Error Message Traceback (most recent call last): File “/home/user/privateGPT/privateGPT.py”, line 57, in <module> main() File “/home/user/privateGPT/privateGPT.py”, line 42, in main res = qa(query)
^^^^^^^^^ 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
Same issue here
Yes.
Same issue here
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.
Same error
Here you have more context - https://gist.github.com/pancutan/8d95dbe52bf3173077a40695d1271b14
same
same issue
already run ingest.py and same issue too 😀
already run ingest.py and created the collections and embedding files in db folder.still getting this issue
try
python ingest.py
first, this should ingest the state of the union text and create an index.same issue +1
Same issue.
same issue +1
Same issue.