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

OpenAI "text-embedding-3-large" model: vector's dimensions must be <= [2048]; got 3072 #14

Open
amotl opened this issue Dec 23, 2024 · 0 comments

Comments

@amotl
Copy link
Member

amotl commented Dec 23, 2024

Problem

When trying to store text embeddings using OpenAI's text-embedding-3-large into CrateDB, LangChain trips.

OpenAIEmbeddings(model="text-embedding-3-large")
sqlalchemy.exc.ProgrammingError: (crate.client.exceptions.ProgrammingError)
SQLParseException[Field [6] vector's dimensions must be <= [2048]; got 3072]
[SQL: INSERT INTO langchain_embedding (id, collection_id, embedding, document, cmetadata) VALUES (?, ?, ?, ?, ?) ON CONFLICT (id) DO UPDATE SET embedding = excluded.embedding, document = excluded.document, cmetadata = excluded.cmetadata]

Details

Processing the SQL DDL statement using FLOAT_VECTOR(3072) succeeds.

CREATE TABLE langchain_embedding (
  id STRING NOT NULL,
  collection_id STRING,
  embedding FLOAT_VECTOR(3072),
  document STRING,
  cmetadata OBJECT,
  PRIMARY KEY (id)
)

The error happens when processing the INSERT statement.

INSERT INTO langchain_embedding (id, collection_id, embedding, document, cmetadata)
VALUES (?, ?, ?, ?, ?) ON CONFLICT (id) DO
UPDATE
SET embedding = excluded.embedding,
    document = excluded.document,
    cmetadata = excluded.cmetadata
@amotl amotl changed the title SQLParseException: Field [6] vector's dimensions must be <= [2048]; got 3072 Problem with OpenAI's text-embedding-3-large model: SQLParseException: Field [6] vector's dimensions must be <= [2048]; got 3072 Dec 23, 2024
@amotl amotl changed the title Problem with OpenAI's text-embedding-3-large model: SQLParseException: Field [6] vector's dimensions must be <= [2048]; got 3072 Problem with OpenAI's "text-embedding-3-large" model: SQLParseException: Field [6] vector's dimensions must be <= [2048]; got 3072 Dec 23, 2024
@amotl amotl changed the title Problem with OpenAI's "text-embedding-3-large" model: SQLParseException: Field [6] vector's dimensions must be <= [2048]; got 3072 Problem with OpenAI's "text-embedding-3-large" model: vector's dimensions must be <= [2048]; got 3072 Dec 23, 2024
@amotl amotl changed the title Problem with OpenAI's "text-embedding-3-large" model: vector's dimensions must be <= [2048]; got 3072 OpenAI "text-embedding-3-large" model: vector's dimensions must be <= [2048]; got 3072 Dec 24, 2024
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

1 participant