Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error creating vector store #6

Closed
aravindhp opened this issue Dec 18, 2023 · 4 comments
Closed

Error creating vector store #6

aravindhp opened this issue Dec 18, 2023 · 4 comments

Comments

@aravindhp
Copy link
Contributor

I am running into the following error:

 rag-demystified   main  python complex_qa.py 
⏳ Connect to EvaDB...
✅ Connected to EvaDB...
Creating vector store for Toronto...
Traceback (most recent call last):
  File "/home/aravindh/devel/ai/rag/lib64/python3.11/site-packages/lark/lexer.py", line 665, in lex
    yield lexer.next_token(lexer_state, parser_state)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/aravindh/devel/ai/rag/lib64/python3.11/site-packages/lark/lexer.py", line 598, in next_token
    raise UnexpectedCharacters(lex_state.text, line_ctr.char_pos, line_ctr.line, line_ctr.column,
lark.exceptions.UnexpectedCharacters: No terminal matches 'F' in the current parser context, at line 1 col 8

CREATE FUNCTION IF NOT EXISTS SentenceFeatureEx
       ^
Expected one of: 
        * INDEX
        * DATABASE
        * UDF
        * TABLE

Previous tokens: Token('CREATE', 'CREATE')


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/aravindh/devel/ai/rag-demystified/complex_qa.py", line 156, in <module>
    vector_stores = generate_vector_stores(cursor, wiki_docs)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/aravindh/devel/ai/rag-demystified/complex_qa.py", line 29, in generate_vector_stores
    cursor.query(
  File "/home/aravindh/devel/ai/rag/lib64/python3.11/site-packages/evadb/interfaces/relational/db.py", line 442, in query
    stmt = parse_query(sql_query)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/home/aravindh/devel/ai/rag/lib64/python3.11/site-packages/evadb/parser/utils.py", line 142, in parse_query
    stmt = Parser().parse(query)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/aravindh/devel/ai/rag/lib64/python3.11/site-packages/evadb/parser/parser.py", line 38, in parse
    lark_output = self._lark_parser.parse(query_string)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/aravindh/devel/ai/rag/lib64/python3.11/site-packages/evadb/parser/lark_parser.py", line 49, in parse
    tree = self._parser.parse(query_string)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/aravindh/devel/ai/rag/lib64/python3.11/site-packages/lark/lark.py", line 658, in parse
    return self.parser.parse(text, start=start, on_error=on_error)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/aravindh/devel/ai/rag/lib64/python3.11/site-packages/lark/parser_frontends.py", line 104, in parse
    return self.parser.parse(stream, chosen_start, **kw)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/aravindh/devel/ai/rag/lib64/python3.11/site-packages/lark/parsers/lalr_parser.py", line 42, in parse
    return self.parser.parse(lexer, start)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/aravindh/devel/ai/rag/lib64/python3.11/site-packages/lark/parsers/lalr_parser.py", line 88, in parse
    return self.parse_from_state(parser_state)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/aravindh/devel/ai/rag/lib64/python3.11/site-packages/lark/parsers/lalr_parser.py", line 111, in parse_from_state
    raise e
  File "/home/aravindh/devel/ai/rag/lib64/python3.11/site-packages/lark/parsers/lalr_parser.py", line 100, in parse_from_state
    for token in state.lexer.lex(state):
  File "/home/aravindh/devel/ai/rag/lib64/python3.11/site-packages/lark/lexer.py", line 674, in lex
    raise UnexpectedToken(token, e.allowed, state=parser_state, token_history=[last_token], terminals_by_name=self.root_lexer.terminals_by_name)
lark.exceptions.UnexpectedToken: Unexpected token Token('ID', 'FUNCTION') at line 1, column 8.
Expected one of: 
        * TABLE
        * DATABASE
        * INDEX
        * UDF
Previous tokens: [Token('CREATE', 'CREATE')]

I am on Fedora 39 running the code in a python 3.11.6 venv with all the requirements satisfied.

@pchunduri6
Copy link
Owner

pchunduri6 commented Dec 21, 2023

Hi @aravindhp , can you try upgrading your evadb installation?

pip install evadb --upgrade

Your code seems to be using an older version of evadb due to some upgrades in other packages.

@aravindhp
Copy link
Contributor Author

Thank you. That fixed the problem.

@aravindhp
Copy link
Contributor Author

BTW, I ran into some errors when upgrading:

 rag-demystified   main  1  pip install evadb --upgrade
Requirement already satisfied: evadb in /home/aravindh/devel/ai/rag/lib64/python3.11/site-packages (0.3.1)
Collecting evadb
  Obtaining dependency information for evadb from https://files.pythonhosted.org/packages/8a/5a/695a26e8f88d49df6f304a047891cb9e0186ab05ec29cb2379da5565e26a/evadb-0.3.9-py3-none-any.whl.metadata
  Using cached evadb-0.3.9-py3-none-any.whl.metadata (20 kB)
Requirement already satisfied: aenum>=2.2.0 in /home/aravindh/devel/ai/rag/lib64/python3.11/site-packages (from evadb) (3.1.15)
Requirement already satisfied: diskcache>=5.4.0 in /home/aravindh/devel/ai/rag/lib64/python3.11/site-packages (from evadb) (5.6.3)
Requirement already satisfied: lark>=1.0.0 in /home/aravindh/devel/ai/rag/lib64/python3.11/site-packages (from evadb) (1.1.8)
Requirement already satisfied: numpy>=1.19.5 in /home/aravindh/devel/ai/rag/lib64/python3.11/site-packages (from evadb) (1.26.2)
Requirement already satisfied: pandas>=1.1.5 in /home/aravindh/devel/ai/rag/lib64/python3.11/site-packages (from evadb) (2.1.4)
Requirement already satisfied: psutil in /home/aravindh/devel/ai/rag/lib64/python3.11/site-packages (from evadb) (5.9.7)
Collecting pydantic<2 (from evadb)
  Obtaining dependency information for pydantic<2 from https://files.pythonhosted.org/packages/d2/16/2edfe3e52de9d46fee81d9b9ace90fd7a49a86e7a36d7fc280183f77515a/pydantic-1.10.13-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata
  Downloading pydantic-1.10.13-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (149 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 149.6/149.6 kB 660.0 kB/s eta 0:00:00
Requirement already satisfied: pyyaml>=5.1 in /home/aravindh/devel/ai/rag/lib64/python3.11/site-packages (from evadb) (6.0.1)
Requirement already satisfied: retry>=0.9.2 in /home/aravindh/devel/ai/rag/lib64/python3.11/site-packages (from evadb) (0.9.2)
Requirement already satisfied: sqlalchemy-utils>=0.36.6 in /home/aravindh/devel/ai/rag/lib64/python3.11/site-packages (from evadb) (0.41.1)
Requirement already satisfied: sqlalchemy>=2.0.0 in /home/aravindh/devel/ai/rag/lib64/python3.11/site-packages (from evadb) (2.0.24)
Requirement already satisfied: thefuzz in /home/aravindh/devel/ai/rag/lib64/python3.11/site-packages (from evadb) (0.20.0)
Requirement already satisfied: python-dateutil>=2.8.2 in /home/aravindh/devel/ai/rag/lib64/python3.11/site-packages (from pandas>=1.1.5->evadb) (2.8.2)
Requirement already satisfied: pytz>=2020.1 in /home/aravindh/devel/ai/rag/lib64/python3.11/site-packages (from pandas>=1.1.5->evadb) (2023.3.post1)
Requirement already satisfied: tzdata>=2022.1 in /home/aravindh/devel/ai/rag/lib64/python3.11/site-packages (from pandas>=1.1.5->evadb) (2023.4)
Requirement already satisfied: typing-extensions>=4.2.0 in /home/aravindh/devel/ai/rag/lib64/python3.11/site-packages (from pydantic<2->evadb) (4.9.0)
Requirement already satisfied: decorator>=3.4.2 in /home/aravindh/devel/ai/rag/lib64/python3.11/site-packages (from retry>=0.9.2->evadb) (5.1.1)
Requirement already satisfied: py<2.0.0,>=1.4.26 in /home/aravindh/devel/ai/rag/lib64/python3.11/site-packages (from retry>=0.9.2->evadb) (1.11.0)
Requirement already satisfied: greenlet!=0.4.17 in /home/aravindh/devel/ai/rag/lib64/python3.11/site-packages (from sqlalchemy>=2.0.0->evadb) (3.0.3)
Requirement already satisfied: rapidfuzz<4.0.0,>=3.0.0 in /home/aravindh/devel/ai/rag/lib64/python3.11/site-packages (from thefuzz->evadb) (3.6.1)
Requirement already satisfied: six>=1.5 in /home/aravindh/devel/ai/rag/lib64/python3.11/site-packages (from python-dateutil>=2.8.2->pandas>=1.1.5->evadb) (1.16.0)
Downloading evadb-0.3.9-py3-none-any.whl (578 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 578.7/578.7 kB 3.7 MB/s eta 0:00:00
Downloading pydantic-1.10.13-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.1/3.1 MB 18.6 MB/s eta 0:00:00
Installing collected packages: pydantic, evadb
  Attempting uninstall: pydantic
    Found existing installation: pydantic 2.4.0
    Uninstalling pydantic-2.4.0:
      Successfully uninstalled pydantic-2.4.0
  Attempting uninstall: evadb
    Found existing installation: evadb 0.3.1
    Uninstalling evadb-0.3.1:
      Successfully uninstalled evadb-0.3.1
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
instructor 0.4.5 requires pydantic<3.0.0,>=2.0.2, but you have pydantic 1.10.13 which is incompatible.
Successfully installed evadb-0.3.9 pydantic-1.10.13
WARNING: There was an error checking the latest version of pip.

I then fixed that by:

 rag-demystified   main  pip install pydantic --upgrade
Requirement already satisfied: pydantic in /home/aravindh/devel/ai/rag/lib64/python3.11/site-packages (1.10.13)
Collecting pydantic
  Obtaining dependency information for pydantic from https://files.pythonhosted.org/packages/dd/b7/9aea7ee6c01fe3f3c03b8ca3c7797c866df5fecece9d6cb27caa138db2e2/pydantic-2.5.3-py3-none-any.whl.metadata
  Downloading pydantic-2.5.3-py3-none-any.whl.metadata (65 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 65.6/65.6 kB 386.8 kB/s eta 0:00:00
Requirement already satisfied: annotated-types>=0.4.0 in /home/aravindh/devel/ai/rag/lib64/python3.11/site-packages (from pydantic) (0.6.0)
Collecting pydantic-core==2.14.6 (from pydantic)
  Obtaining dependency information for pydantic-core==2.14.6 from https://files.pythonhosted.org/packages/e7/84/2dc88180fc6f0d13aab2a47a53b89c2dbc239e2a87d0a58e31077e111e82/pydantic_core-2.14.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata
  Downloading pydantic_core-2.14.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (6.5 kB)
Requirement already satisfied: typing-extensions>=4.6.1 in /home/aravindh/devel/ai/rag/lib64/python3.11/site-packages (from pydantic) (4.9.0)
Downloading pydantic-2.5.3-py3-none-any.whl (381 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 381.9/381.9 kB 2.1 MB/s eta 0:00:00
Downloading pydantic_core-2.14.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.1 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 12.0 MB/s eta 0:00:00
Installing collected packages: pydantic-core, pydantic
  Attempting uninstall: pydantic-core
    Found existing installation: pydantic_core 2.10.0
    Uninstalling pydantic_core-2.10.0:
      Successfully uninstalled pydantic_core-2.10.0
  Attempting uninstall: pydantic
    Found existing installation: pydantic 1.10.13
    Uninstalling pydantic-1.10.13:
      Successfully uninstalled pydantic-1.10.13
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
evadb 0.3.9 requires pydantic<2, but you have pydantic 2.5.3 which is incompatible.
Successfully installed pydantic-2.5.3 pydantic-core-2.14.6

I am able to proceed further with this but not sure if the above incompatibility will cause issues later.

@pchunduri6
Copy link
Owner

Thanks for pointing this out. This is a known issue caused by the Pydantic version limitations in Ray (ray-project/ray#37019). The incompatibility may only be an issue in the unlikely case that you want to use the advanced Ray features of EvaDB.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants