PromtEngineer / localGPT

Chat with your documents on your local device using GPT models. No data leaves your device and 100% private.
Apache License 2.0
20.13k stars 2.25k forks source link

ValueError: You are using a deprecated configuration of Chroma. #252

Open JakeCob opened 1 year ago

JakeCob commented 1 year ago

PS D:\OneDrive\Sevron\OneDrive - Sevron Ltd\Project\1st Project\Reference\localGPT> python ingest.py --device_type cpu
2023-07-24 06:41:45,608 - INFO - ingest.py:120 - Loading documents from D:\OneDrive\Sevron\OneDrive - Sevron Ltd\Project\1st Project\Reference\localGPT/SOURCE_DOCUMENTS 2023-07-24 06:41:51,593 - INFO - ingest.py:129 - Loaded 2 documents from D:\OneDrive\Sevron\OneDrive - Sevron Ltd\Project\1st Project\Reference\localGPT/SOURCE_DOCUMENTS 2023-07-24 06:41:51,593 - INFO - ingest.py:130 - Split into 111 chunks of text 2023-07-24 06:41:55,346 - INFO - SentenceTransformer.py:66 - Load pretrained SentenceTransformer: hkunlp/instructor-large load INSTRUCTOR_Transformer max_seq_length 512 Traceback (most recent call last): File "D:\OneDrive\Sevron\OneDrive - Sevron Ltd\Project\1st Project\Reference\localGPT\ingest.py", line 158, in main() File "D:\Program Files\Nerd Stuffs\Programming Languages\Python\Python311\Lib\site-packages\click\core.py", line 1157, in call return self.main(args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Program Files\Nerd Stuffs\Programming Languages\Python\Python311\Lib\site-packages\click\core.py", line 1078, in main
rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "D:\Program Files\Nerd Stuffs\Programming Languages\Python\Python311\Lib\site-packages\click\core.py", line 1434, in invoke
return ctx.invoke(self.callback,
ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Program Files\Nerd Stuffs\Programming Languages\Python\Python311\Lib\site-packages\click\core.py", line 783, in invoke
return __callback(
args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\OneDrive\Sevron\OneDrive - Sevron Ltd\Project\1st Project\Reference\localGPT\ingest.py", line 144, in main db = Chroma.from_documents( ^^^^^^^^^^^^^^^^^^^^^^ File "D:\Program Files\Nerd Stuffs\Programming Languages\Python\Python311\Lib\site-packages\langchain\vectorstores\chroma.py", line 578, in from_documents return cls.from_texts( ^^^^^^^^^^^^^^^ File "D:\Program Files\Nerd Stuffs\Programming Languages\Python\Python311\Lib\site-packages\langchain\vectorstores\chroma.py", line 533, in from_texts chroma_collection = cls( ^^^^ File "D:\Program Files\Nerd Stuffs\Programming Languages\Python\Python311\Lib\site-packages\langchain\vectorstores\chroma.py", line 109, in init self._client = chromadb.Client(_client_settings) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\Program Files\Nerd Stuffs\Programming Languages\Python\Python311\Lib\site-packages\chromadb__init.py", line 107, in Client system = System(settings) ^^^^^^^^^^^^^^^^ File "D:\Program Files\Nerd Stuffs\Programming Languages\Python\Python311\Lib\site-packages\chromadb\config.py", line 175, in init__ if settings[key] is not None:


  File "D:\Program Files\Nerd Stuffs\Programming Languages\Python\Python311\Lib\site-packages\chromadb\config.py", line 110, in __getitem__
    raise ValueError(LEGACY_ERROR)
ValueError: You are using a deprecated configuration of Chroma.

If you do not have data you wish to migrate, you only need to change how you construct
your Chroma client. Please see the "New Clients" section of https://docs.trychroma.com/migration.
________________________________________________________________________________________________

If you do have data you wish to migrate, we have a migration tool you can use in order to
migrate your data to the new Chroma architecture.
Please `pip install chroma-migrate` and run `chroma-migrate` to migrate your data and then
change how you construct your Chroma client.

See https://docs.trychroma.com/migration for more information or join our discord at https://discord.gg/8g5FESbj for help!

How can I fix this error?
chrishart0 commented 1 year ago

Ran into this same issue. Check these docs here: https://docs.trychroma.com/migration. Looks like we need to be below version 0.4.0 until Langchain updates to handle for this.

The fix is to peg yourself to chromadb==0.3.29 which is the last version before 0.4.0.