AIAnytime / Search-Your-PDF-App

Search Your PDF App using Langchain, ChromaDB, Sentence Transformers, and LaMiNi LM Model. This app is completely powered by Open Source Models. No OpenAI key is required.
MIT License
54 stars 41 forks source link

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

Open alucard001 opened 1 year ago

alucard001 commented 1 year ago

To keep it short, when I download your code and run, it throws the following error:

Traceback (most recent call last):
  File "/Users/alucard/mambaforge/envs/searchpdf/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 552, in _run_script
    exec(code, module.__dict__)
  File "/Users/alucard/llama2/searchpdf/app.py", line 75, in <module>
    main()
  File "/Users/alucard/llama2/searchpdf/app.py", line 69, in main
    answer, metadata = process_answer(question)
  File "/Users/alucard/llama2/searchpdf/app.py", line 44, in process_answer
    qa = qa_llm()
  File "/Users/alucard/mambaforge/envs/searchpdf/lib/python3.10/site-packages/streamlit/runtime/caching/cache_utils.py", line 211, in wrapper
    return cached_func(*args, **kwargs)
  File "/Users/alucard/mambaforge/envs/searchpdf/lib/python3.10/site-packages/streamlit/runtime/caching/cache_utils.py", line 240, in __call__
    return self._get_or_create_cached_value(args, kwargs)
  File "/Users/alucard/mambaforge/envs/searchpdf/lib/python3.10/site-packages/streamlit/runtime/caching/cache_utils.py", line 266, in _get_or_create_cached_value
    return self._handle_cache_miss(cache, value_key, func_args, func_kwargs)
  File "/Users/alucard/mambaforge/envs/searchpdf/lib/python3.10/site-packages/streamlit/runtime/caching/cache_utils.py", line 320, in _handle_cache_miss
    computed_value = self._info.func(*func_args, **func_kwargs)
  File "/Users/alucard/llama2/searchpdf/app.py", line 36, in qa_llm
    db = Chroma(persist_directory="db", embedding_function=embeddings, client_settings=CHROMA_SETTINGS)
  File "/Users/alucard/mambaforge/envs/searchpdf/lib/python3.10/site-packages/langchain/vectorstores/chroma.py", line 119, in __init__
    self._client = chromadb.Client(_client_settings)
  File "/Users/alucard/mambaforge/envs/searchpdf/lib/python3.10/site-packages/chromadb/__init__.py", line 140, in Client
    system = System(settings)
  File "/Users/alucard/mambaforge/envs/searchpdf/lib/python3.10/site-packages/chromadb/config.py", line 227, in __init__
    if settings[key] is not None:
  File "/Users/alucard/mambaforge/envs/searchpdf/lib/python3.10/site-packages/chromadb/config.py", line 164, in __getitem__
    raise ValueError(LEGACY_ERROR)
ValueError: You are using a deprecated configuration of Chroma.

It seems that Chroma has been updated but your code did not reflect that.

Just in case you want to know, here is the list when I run conda list.

Chromadb is 0.4.8

accelerate                0.22.0                   pypi_0    pypi
aiohttp                   3.8.5                    pypi_0    pypi
aiosignal                 1.3.1                    pypi_0    pypi
altair                    5.1.1                    pypi_0    pypi
anyio                     4.0.0                    pypi_0    pypi
async-timeout             4.0.3                    pypi_0    pypi
attrs                     23.1.0                   pypi_0    pypi
backoff                   2.2.1                    pypi_0    pypi
bcrypt                    4.0.1                    pypi_0    pypi
beautifulsoup4            4.12.2                   pypi_0    pypi
bitsandbytes              0.41.1                   pypi_0    pypi
blinker                   1.6.2                    pypi_0    pypi
bs4                       0.0.1                    pypi_0    pypi
bzip2                     1.0.8                h3422bc3_4    conda-forge
ca-certificates           2023.7.22            hf0a4a13_0    conda-forge
cachetools                5.3.1                    pypi_0    pypi
certifi                   2023.7.22                pypi_0    pypi
cffi                      1.15.1                   pypi_0    pypi
charset-normalizer        3.2.0                    pypi_0    pypi
chroma-hnswlib            0.7.2                    pypi_0    pypi
chromadb                  0.4.8                    pypi_0    pypi
click                     8.1.7                    pypi_0    pypi
coloredlogs               15.0.1                   pypi_0    pypi
cryptography              41.0.3                   pypi_0    pypi
dataclasses-json          0.5.14                   pypi_0    pypi
einops                    0.6.1                    pypi_0    pypi
exceptiongroup            1.1.3                    pypi_0    pypi
fastapi                   0.99.1                   pypi_0    pypi
filelock                  3.12.3                   pypi_0    pypi
flatbuffers               23.5.26                  pypi_0    pypi
frozenlist                1.4.0                    pypi_0    pypi
fsspec                    2023.9.0                 pypi_0    pypi
gitdb                     4.0.10                   pypi_0    pypi
gitpython                 3.1.34                   pypi_0    pypi
h11                       0.14.0                   pypi_0    pypi
httptools                 0.6.0                    pypi_0    pypi
huggingface-hub           0.16.4                   pypi_0    pypi
humanfriendly             10.0                     pypi_0    pypi
idna                      3.4                      pypi_0    pypi
importlib-metadata        6.8.0                    pypi_0    pypi
importlib-resources       6.0.1                    pypi_0    pypi
jinja2                    3.1.2                    pypi_0    pypi
joblib                    1.3.2                    pypi_0    pypi
jsonschema                4.19.0                   pypi_0    pypi
jsonschema-specifications 2023.7.1                 pypi_0    pypi
langchain                 0.0.279                  pypi_0    pypi
langsmith                 0.0.33                   pypi_0    pypi
libffi                    3.4.2                h3422bc3_5    conda-forge
libsqlite                 3.43.0               hb31c410_0    conda-forge
libzlib                   1.2.13               h53f4e23_5    conda-forge
markdown-it-py            3.0.0                    pypi_0    pypi
markupsafe                2.1.3                    pypi_0    pypi
marshmallow               3.20.1                   pypi_0    pypi
mdurl                     0.1.2                    pypi_0    pypi
monotonic                 1.6                      pypi_0    pypi
mpmath                    1.3.0                    pypi_0    pypi
multidict                 6.0.4                    pypi_0    pypi
mypy-extensions           1.0.0                    pypi_0    pypi
ncurses                   6.4                  h7ea286d_0    conda-forge
networkx                  3.1                      pypi_0    pypi
nltk                      3.8.1                    pypi_0    pypi
numexpr                   2.8.5                    pypi_0    pypi
numpy                     1.25.2                   pypi_0    pypi
onnxruntime               1.15.1                   pypi_0    pypi
openssl                   3.1.2                h53f4e23_0    conda-forge
overrides                 7.4.0                    pypi_0    pypi
packaging                 23.1                     pypi_0    pypi
pandas                    2.1.0                    pypi_0    pypi
pdfminer-six              20221105                 pypi_0    pypi
pillow                    9.5.0                    pypi_0    pypi
pip                       23.2.1             pyhd8ed1ab_0    conda-forge
posthog                   3.0.2                    pypi_0    pypi
protobuf                  4.24.2                   pypi_0    pypi
psutil                    5.9.5                    pypi_0    pypi
pulsar-client             3.3.0                    pypi_0    pypi
pyarrow                   13.0.0                   pypi_0    pypi
pycparser                 2.21                     pypi_0    pypi
pydantic                  1.10.12                  pypi_0    pypi
pydeck                    0.8.0                    pypi_0    pypi
pygments                  2.16.1                   pypi_0    pypi
pympler                   1.0.1                    pypi_0    pypi
pypika                    0.48.9                   pypi_0    pypi
python                    3.10.12         h01493a6_0_cpython    conda-forge
python-dateutil           2.8.2                    pypi_0    pypi
python-dotenv             1.0.0                    pypi_0    pypi
pytz                      2023.3                   pypi_0    pypi
pytz-deprecation-shim     0.1.0.post0              pypi_0    pypi
pyyaml                    6.0.1                    pypi_0    pypi
readline                  8.2                  h92ec313_1    conda-forge
referencing               0.30.2                   pypi_0    pypi
regex                     2023.8.8                 pypi_0    pypi
requests                  2.31.0                   pypi_0    pypi
rich                      13.5.2                   pypi_0    pypi
rpds-py                   0.10.0                   pypi_0    pypi
safetensors               0.3.3                    pypi_0    pypi
scikit-learn              1.3.0                    pypi_0    pypi
scipy                     1.11.2                   pypi_0    pypi
sentence-transformers     2.2.2                    pypi_0    pypi
sentencepiece             0.1.99                   pypi_0    pypi
setuptools                68.1.2             pyhd8ed1ab_0    conda-forge
six                       1.16.0                   pypi_0    pypi
smmap                     5.0.0                    pypi_0    pypi
sniffio                   1.3.0                    pypi_0    pypi
soupsieve                 2.5                      pypi_0    pypi
sqlalchemy                2.0.20                   pypi_0    pypi
starlette                 0.27.0                   pypi_0    pypi
streamlit                 1.26.0                   pypi_0    pypi
sympy                     1.12                     pypi_0    pypi
tenacity                  8.2.3                    pypi_0    pypi
threadpoolctl             3.2.0                    pypi_0    pypi
tk                        8.6.12               he1e0b03_0    conda-forge
tokenizers                0.13.3                   pypi_0    pypi
toml                      0.10.2                   pypi_0    pypi
toolz                     0.12.0                   pypi_0    pypi
torch                     2.0.1                    pypi_0    pypi
torchvision               0.15.2                   pypi_0    pypi
tornado                   6.3.3                    pypi_0    pypi
tqdm                      4.66.1                   pypi_0    pypi
transformers              4.32.1                   pypi_0    pypi
typing-extensions         4.7.1                    pypi_0    pypi
typing-inspect            0.9.0                    pypi_0    pypi
tzdata                    2023.3                   pypi_0    pypi
tzlocal                   4.3.1                    pypi_0    pypi
urllib3                   2.0.4                    pypi_0    pypi
uvicorn                   0.23.2                   pypi_0    pypi
uvloop                    0.17.0                   pypi_0    pypi
validators                0.22.0                   pypi_0    pypi
watchfiles                0.20.0                   pypi_0    pypi
websockets                11.0.3                   pypi_0    pypi
wheel                     0.41.2             pyhd8ed1ab_0    conda-forge
xz                        5.2.6                h57fd34a_0    conda-forge
yarl                      1.9.2                    pypi_0    pypi
zipp                      3.16.2                   pypi_0    pypi

Can you please help?

Thank you.

luiyen commented 1 year ago

Try this @alucard001 https://github.com/AIAnytime/Search-Your-PDF-App/pull/3