OoriData / OgbujiPT

Client-side toolkit for using large language models, including where self-hosted
Apache License 2.0
102 stars 8 forks source link

RUntimeError register_vector: unknown type: pg_catalog.vector #89

Open chimezie opened 1 week ago

chimezie commented 1 week ago

Using the latest Ogbujipt from Git, pgvector version 0.3.6 installed, and while initializing a DocDB instance via DocDB.from_conn_params with the following:

    db = await DocDB.from_conn_params(
        embedding_model=SentenceTransformer('all-MiniLM-L12-v2'),
        table_name='.. table name ..',
        user=os.environ['DATABASE_USERNAME'],
        password=os.environ['DATABASE_PASSWORD'],
        db_name=os.environ['DATABASE_NAME'],
        host=os.environ['DATABASE_HOST'],
        port=int(os.environ['DATABASE_PORT'])
    )

I get:

  File "/path/to/site-packages/asyncpg/pool.py", line 512, in _get_new_connection
    await self._init(con)
  File "/path/to/site-packages/ogbujipt/embedding/pgvector.py", line 211, in init_pool
    raise RuntimeError(f'Unable to find vector type in the DB/schema. You might need to enable it: {e}')
RuntimeError: Unable to find vector type in the DB/schema. You might need to enable it: unknown type: pg_catalog.vector
uogbuji commented 1 week ago

Huh. Weird. DocDB is no longer a thing. We removed it a couple of major releases ago because you can achieve the same thing with DataDB, via metadata. I would have expected an error on import. Could you try on a clean venv, to help get a clearer picture of what's going on?