Leon-Sander / Local-Multimodal-AI-Chat

GNU General Public License v3.0
124 stars 73 forks source link

Getting error while loading PDF #5

Closed rs-biz closed 4 days ago

rs-biz commented 8 months ago

I am getting this error . Any idea what might be the issue ? llm_chains.py", line 43, in load_vectordb persistent_client = chromadb.PersistentClient(chromadb) ^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: module 'chromadb' has no attribute 'PersistentClient'

Leon-Sander commented 8 months ago

You need to write a string into the PersistentClient, which will be the name of your vector database folder. The error message seems to be something else, but try this out at first please. If this does not solve the problem, then please post the complete error message.

persistent_client = chromadb.PersistentClient("chroma_db")

rs-biz commented 8 months ago

You need to write a string into the PersistentClient, which will be the name of your vector database folder. The error message seems to be something else, but try this out at first please. If this does not solve the problem, then please post the complete error message.

persistent_client = chromadb.PersistentClient("chroma_db")

Thank you so much for responding ! I am getting the following error message after making the change you recommended . Confirmed that I have a folder chroma_db in the same directory as the app.py. I am running python 3.12 version.

AttributeError: module 'chromadb' has no attribute 'PersistentClient' Traceback: File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 534, in _run_script exec(code, module.dict) File "/app.py", line 134, in main() File "/app.py", line 87, in main add_documents_to_db(uploaded_pdf) File "/Users/ramesh/Bizagi/code/Bchat/pdf_handler.py", line 27, in add_documents_to_db vector_db = load_vectordb(create_embeddings()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/llm_chains.py", line 45, in load_vectordb persistent_client = chromadb.PersistentClient("chroma_db") ^^^^^^^^^^^^^^^^^^^^^^^^^

Leon-Sander commented 8 months ago

Which requirements file did you install, and did you upgrade pip to the newest version before installing the requirements?

rs-biz commented 8 months ago

Thanks again for responding . Yes, I did upgrade pip before installing. I used requirements.txt that is in the repo as requirement file . Confirming that folder chroma_db exist in same folder as app.py.

Leon-Sander commented 8 months ago

After some research I found a suggestion to try: pip install --upgrade chromadb If this does not work, then I would recommend using another python version. I used Python 3.10.12 in my environment.