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

embedding demension change bug #12913

Open
5 tasks done
huangzhuo1949 opened this issue Jan 21, 2025 · 2 comments · May be fixed by #12914
Open
5 tasks done

embedding demension change bug #12913

huangzhuo1949 opened this issue Jan 21, 2025 · 2 comments · May be fixed by #12914
Labels
🐞 bug Something isn't working 👻 feat:rag Embedding related issue, like qdrant, weaviate, milvus, vector database.

Comments

@huangzhuo1949
Copy link
Contributor

huangzhuo1949 commented Jan 21, 2025

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

v0.15.1

Cloud or Self Hosted

Self Hosted (Source), Self Hosted (Docker)

Steps to reproduce

ERROR:root:consume document failed
Traceback (most recent call last):
  File "/app/api/core/indexing_runner.py", line 205, in run
    raise e
  File "/app/api/core/indexing_runner.py", line 195, in run
    self._load(
  File "/app/api/core/indexing_runner.py", line 831, in _load
    tokens += future.result()
              ^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 456, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 59, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/core/indexing_runner.py", line 888, in _process_chunk
    index_processor.load(dataset, chunk_documents, with_keywords=False)
  File "/app/api/core/rag/index_processor/processor/paragraph_index_processor.py", line 57, in load
    vector.create(documents)
  File "/app/api/core/rag/datasource/vdb/vector_factory.py", line 151, in create
    self._vector_processor.create(texts=texts, embeddings=embeddings, **kwargs)
  File "/app/api/core/rag/datasource/vdb/pgvector/pgvector.py", line 95, in create
    return self.add_texts(texts, embeddings)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/api/core/rag/datasource/vdb/pgvector/pgvector.py", line 112, in add_texts
    psycopg2.extras.execute_values(
  File "/app/api/.venv/lib/python3.12/site-packages/psycopg2/extras.py", line 1299, in execute_values
    cur.execute(b''.join(parts))
psycopg2.errors.DataException: expected 1536 dimensions, not 1024

✔️ Expected Behavior

No response

❌ Actual Behavior

No response

Copy link

dosubot bot commented Jan 21, 2025

To resolve the "expected 1536 dimensions, not 1024" error in your self-hosted Dify v0.15.1 setup, you should ensure that the embedding model is set to 'text-embedding-ada-002', which uses 1536 dimensions. Additionally, check the settings of each document in your dataset to confirm they are using the same embedding model. If there are any documents with inconsistent dimensions, reindex them to align all documents to the expected 1536 dimensions [1].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@huangzhuo1949
Copy link
Contributor Author

fix in #12914

@dosubot dosubot bot added 🐞 bug Something isn't working 👻 feat:rag Embedding related issue, like qdrant, weaviate, milvus, vector database. labels Jan 21, 2025
@crazywoola crazywoola linked a pull request Jan 21, 2025 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working 👻 feat:rag Embedding related issue, like qdrant, weaviate, milvus, vector database.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant