# OpenAI's text-embedding-ada-002 error "Embedding dimensions"

**URL:** https://meta.discourse.org/t/openais-text-embedding-ada-002-error-embedding-dimensions/348244
**Category:** Bug
**Tags:** embedding, ai
**Created:** [January 21, 2025, 7:39pm UTC](https://meta.discourse.org/t/openais-text-embedding-ada-002-error-embedding-dimensions/348244 "2025-01-21T19:39:54Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![kuaza](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kuaza/32/264151_2.png) [@kuaza](https://meta.discourse.org/u/kuaza)
#### Post date: [January 21, 2025, 7:39pm UTC](https://meta.discourse.org/t/openais-text-embedding-ada-002-error-embedding-dimensions/348244/1 "2025-01-21T19:39:54Z")

</div>

Now, in the work I have done, the test does not work while installing, but it can be saved. After saving, when I selected this module "“text-embedding-ada-002"” from the settings, I saw that it works on the site. However, I am not sure if it adds new topics. This code gives an error “rake ai:embeddings:backfill”:

```plaintext
rake aborted!
NameError: uninitialized constant DiscourseAi::Embeddings::VectorRepresentations (NameError)

    vector_rep = DiscourseAi::Embeddings::VectorRepresentations::Base.current_representation
                                        ^^^^^^^^^^^^^^^^^^^^^^^
/var/www/discourse/plugins/discourse-ai/lib/tasks/modules/embeddings/database.rake:14:in `block in <main>'

```

**While editing topics, AI gives an error while finding categories and tags. But the title generator works.**

* * *

Hello, thanks for the update and correction work. I am trying to configure the embed module. Please note that after the update, some of the topics could not be accessed (new topics), I think it was because the embed feature was not installed. I am trying to install “text-embedding-ada-002”, which I used in the previous settings, but the “Embedding dimensions” setting is causing problems. If I leave it blank, the test passes, but it does not save because it is blank. If I enter a number, it gives the error message below. For now, I installed “OpenAI’s text-embedding-3-large”, the test passed, I think it may take some time to work on the topics, but I do not know what the difference is from the “text-embedding-ada-002” structure.

 ![image](https://global.discourse-cdn.com/meta/original/4X/f/2/f/f2fce90a4c21cf7be3b5bc64dd17910dcee26fa8.png)

If I delete that part (Embedding dimensions), the test runs but does not save because it warns me that that area should not be empty.

 ![image](https://global.discourse-cdn.com/meta/original/4X/1/7/d/17d447ded8c80f8098ca13d64ce70dc2bfefa136.png)

If we want to save it, it gives this error: An error occurred: Dimensions cannot be empty

---

<div class="post-metadata">

### Author: ![Roman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/roman/32/157504_2.png) [@Roman](https://meta.discourse.org/u/Roman)
#### Post date: [January 21, 2025, 9:00pm UTC](https://meta.discourse.org/t/openais-text-embedding-ada-002-error-embedding-dimensions/348244/3 "2025-01-21T21:00:08Z")

</div>

> [@kuaza](#):
>
> If we want to save it, it gives this error: An error occurred: Dimensions cannot be empty

This is fixed by:

[https://github.com/discourse/discourse-ai/pull/1080](https://github.com/discourse/discourse-ai/pull/1080)

You should be able to set dimensions for `text-embedding-3-*`. For the large one, use the preset value of `2000`.

> [@kuaza](#):
>
> However, I am not sure if it adds new topics.

There’s a backfill job that runs every five minutes and with eventually generate embeddings for all topics.

> [@kuaza](#):
>
> This code gives an error “rake ai:embeddings:backfill”:

I’ll post here once this is fixed.

---

<div class="post-metadata">

### Author: ![kuaza](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/kuaza/32/264151_2.png) [@kuaza](https://meta.discourse.org/u/kuaza)
#### Post date: [January 21, 2025, 9:32pm UTC](https://meta.discourse.org/t/openais-text-embedding-ada-002-error-embedding-dimensions/348244/4 "2025-01-21T21:32:26Z")

</div>

- Fixed “Embedding dimensions” issue.
- Fixed this error: “OpenAI Embeddings failed with status: 400 body: { “error”: { “message”: “This model does not support specifying dimensions.”, “type”: “invalid\_request\_error”, “param”: null, “code”:”
- “Run test” and “save” work.
- Fixed category and tag specification with ai.
- Topic summaries creation started to be seen.

Thank you boss 👏 👏 👏 👏 👏 👏 👏

---

<div class="post-metadata">

### Author: ![Roman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/roman/32/157504_2.png) [@Roman](https://meta.discourse.org/u/Roman)
#### Post date: [January 22, 2025, 5:16pm UTC](https://meta.discourse.org/t/openais-text-embedding-ada-002-error-embedding-dimensions/348244/5 "2025-01-22T17:16:30Z")

</div>

The backfill embeddings rake task is fixed per:

[https://github.com/discourse/discourse-ai/pull/1084](https://github.com/discourse/discourse-ai/pull/1084)

---

<div class="post-metadata">

### Author: ![Roman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/roman/32/157504_2.png) [@Roman](https://meta.discourse.org/u/Roman)
#### Post date: [January 25, 2025, 11:00am UTC](https://meta.discourse.org/t/openais-text-embedding-ada-002-error-embedding-dimensions/348244/7 "2025-01-25T11:00:50Z")

</div>

This topic was automatically closed after 2 days. New replies are no longer allowed.
