langchain-ai / chat-langchain

https://chat.langchain.com
MIT License
5.47k stars 1.28k forks source link

ingest failing with beautifulsoup warning #105

Open sharrajesh opened 1 year ago

sharrajesh commented 1 year ago

/home/rajeshsharma/code/others/chat-langchain/venv/bin/python /snap/pycharm-professional/344/plugins/python/helpers/pydev/pydevd.py --multiprocess --qt-support=auto --client 127.0.0.1 --port 35709 --file /home/rajeshsharma/code/others/chat-langchain/ingest.py Connected to pydev debugger (build 231.9225.15) /home/rajeshsharma/code/others/chat-langchain/venv/lib/python3.11/site-packages/langchain/document_loaders/readthedocs.py:48: GuessedAtParserWarning: No parser was explicitly specified, so I'm using the best available HTML parser for this system ("lxml"). This usually isn't a problem, but if you run this code on another system, or in a different virtual environment, it may use a different parser and behave differently. The code that caused this warning is on line 48 of the file /home/rajeshsharma/code/others/chat-langchain/venv/lib/python3.11/site-packages/langchain/documentloaders/readthedocs.py. To get rid of this warning, pass the additional argument 'features="lxml"' to the BeautifulSoup constructor. = BeautifulSoup( /home/rajeshsharma/code/others/chat-langchain/venv/lib/python3.11/site-packages/langchain/document_loaders/readthedocs.py:75: GuessedAtParserWarning: No parser was explicitly specified, so I'm using the best available HTML parser for this system ("lxml"). This usually isn't a problem, but if you run this code on another system, or in a different virtual environment, it may use a different parser and behave differently. The code that caused this warning is on line 75 of the file /home/rajeshsharma/code/others/chat-langchain/venv/lib/python3.11/site-packages/langchain/document_loaders/readthedocs.py. To get rid of this warning, pass the additional argument 'features="lxml"' to the BeautifulSoup constructor. soup = BeautifulSoup(data, self.bs_kwargs) Traceback (most recent call last): File "/snap/pycharm-professional/344/plugins/python/helpers/pydev/pydevd.py", line 1496, in _exec pydev_imports.execfile(file, globals, locals) # execute the script ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/snap/pycharm-professional/344/plugins/python/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "/home/rajeshsharma/code/others/chat-langchain/ingest.py", line 31, in ingest_docs() File "/home/rajeshsharma/code/others/chat-langchain/ingest.py", line 23, in ingest_docs vectorstore = FAISS.from_documents(documents, embeddings) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/rajeshsharma/code/others/chat-langchain/venv/lib/python3.11/site-packages/langchain/vectorstores/base.py", line 413, in from_documents return cls.from_texts(texts, embedding, metadatas=metadatas, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/rajeshsharma/code/others/chat-langchain/venv/lib/python3.11/site-packages/langchain/vectorstores/faiss.py", line 578, in from_texts return cls.from( ^^^^^^^^^^^ File "/home/rajeshsharma/code/others/chat-langchain/venv/lib/python3.11/site-packages/langchain/vectorstores/faiss.py", line 522, in from index = faiss.IndexFlatL2(len(embeddings[0]))


IndexError: list index out of range
python-BaseException
ailyfeng commented 1 year ago

me too