techleadhd / chatgpt-retrieval

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

trigram error

llandegla opened this issue · comments

I'm getting this error when I try to run within Google Colab notebook:

Traceback (most recent call last):
File "/content/chatgpt-retrieval/chatgpt.py", line 35, in
index = VectorstoreIndexCreator().from_loaders([loader])
File "/usr/local/lib/python3.10/dist-packages/langchain/indexes/vectorstore.py", line 73, in from_loaders
return self.from_documents(docs)
File "/usr/local/lib/python3.10/dist-packages/langchain/indexes/vectorstore.py", line 78, in from_documents
vectorstore = self.vectorstore_cls.from_documents(
File "/usr/local/lib/python3.10/dist-packages/langchain/vectorstores/chroma.py", line 564, in from_documents
return cls.from_texts(
File "/usr/local/lib/python3.10/dist-packages/langchain/vectorstores/chroma.py", line 519, in from_texts
chroma_collection = cls(
File "/usr/local/lib/python3.10/dist-packages/langchain/vectorstores/chroma.py", line 104, in init
self._client = chromadb.Client(_client_settings)
File "/usr/local/lib/python3.10/dist-packages/chromadb/init.py", line 86, in Client
system.start()
File "/usr/local/lib/python3.10/dist-packages/chromadb/config.py", line 205, in start
component.start()
File "/usr/local/lib/python3.10/dist-packages/chromadb/db/impl/sqlite.py", line 92, in start
self.initialize_migrations()
File "/usr/local/lib/python3.10/dist-packages/chromadb/db/migrations.py", line 128, in initialize_migrations
self.apply_migrations()
File "/usr/local/lib/python3.10/dist-packages/chromadb/db/migrations.py", line 156, in apply_migrations
self.apply_migration(cur, migration)
File "/usr/local/lib/python3.10/dist-packages/chromadb/db/impl/sqlite.py", line 209, in apply_migration
cur.executescript(migration["sql"])
sqlite3.OperationalError: no such tokenizer: trigram

I just had the same error, downgrading chromadb to 0.3.29 solved it.
Ie sth like this: pip3.11 install --force-reinstall -v "chromadb==0.3.29"

I just had the same error, downgrading chromadb to 0.3.29 solved it. Ie sth like this: pip3.11 install --force-reinstall -v "chromadb==0.3.29"

any solution to this error?
Traceback (most recent call last):
File "C:\Users\enrui\Downloads\chatgpt-retrieval-main (1)\chatgpt-retrieval-main\chatgpt.py", line 35, in
index = VectorstoreIndexCreator().from_loaders([loader])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\enrui\AppData\Local\Programs\Python\Python311\Lib\site-packages\langchain\indexes\vectorstore.py", line 72, in from_loaders
docs.extend(loader.load())
^^^^^^^^^^^^^
File "C:\Users\enrui\AppData\Local\Programs\Python\Python311\Lib\site-packages\langchain\document_loaders\directory.py", line 108, in load
self.load_file(i, p, docs, pbar)
File "C:\Users\enrui\AppData\Local\Programs\Python\Python311\Lib\site-packages\langchain\document_loaders\directory.py", line 69, in load_file
raise e
File "C:\Users\enrui\AppData\Local\Programs\Python\Python311\Lib\site-packages\langchain\document_loaders\directory.py", line 63, in load_file
sub_docs = self.loader_cls(str(item), **self.loader_kwargs).load()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\enrui\AppData\Local\Programs\Python\Python311\Lib\site-packages\langchain\document_loaders\unstructured.py", line 71, in load
elements = self._get_elements()
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\enrui\AppData\Local\Programs\Python\Python311\Lib\site-packages\langchain\document_loaders\unstructured.py", line 106, in _get_elements
from unstructured.partition.auto import partition
File "C:\Users\enrui\AppData\Local\Programs\Python\Python311\Lib\site-packages\unstructured\partition\auto.py", line 21, in
from unstructured.partition.image import partition_image
File "C:\Users\enrui\AppData\Local\Programs\Python\Python311\Lib\site-packages\unstructured\partition\image.py", line 5, in
from unstructured.partition.pdf import partition_pdf_or_image
File "C:\Users\enrui\AppData\Local\Programs\Python\Python311\Lib\site-packages\unstructured\partition\pdf.py", line 9, in
from pdfminer.high_level import extract_pages
ImportError: cannot import name 'extract_pages' from 'pdfminer.high_level' (C:\Users\enrui\AppData\Local\Programs\Python\Python311\Lib\site-packages\pdfminer\high_level.py)

install --force-reinstall -v "chromadb==0.3.29"

That worked for me perfectly... Thank You @majzlik

Worked for me too. Thank you @majzlik

I'm working in Google Colab so I used this:

pip install langchain openai chromadb==0.3.29 tiktoken unstructured