Unable to change the Embedding Model #4942

Closed
opened 2026-02-21 18:08:42 -05:00 by yindo · 4 comments
Owner

Originally created by @dc-vin on GitHub (Aug 7, 2024).

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

0.6.9

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

After changing the Embedding Model in Knowledge settings and clicking save, the Embedding Model reverts to the original model upon the next login.
image
When I change the model from 002 to small and click save, upon logging in again, the model reverts to 002.

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @dc-vin on GitHub (Aug 7, 2024). ### Self Checks - [X] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [X] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [X] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [X] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [X] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.6.9 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce After changing the Embedding Model in Knowledge settings and clicking save, the Embedding Model reverts to the original model upon the next login. ![image](https://github.com/user-attachments/assets/403b1ded-6f8d-4cb1-8fc3-cbe793c27412) When I change the model from 002 to small and click save, upon logging in again, the model reverts to 002. ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug🤔 cant-reproduce labels 2026-02-21 18:08:42 -05:00
yindo closed this issue 2026-02-21 18:08:42 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Aug 7, 2024):

The issue where the Embedding Model in the Knowledge settings of Dify version 0.6.9 reverts to "text-embedding-ada-002" after changing it to "small" and saving is likely due to the external access name configuration in LocalAI. By default, the external access name for the embedding model all-MiniLM-L6-v2 is set to text-embedding-ada-002.

To resolve this issue, you need to customize the external access name in the models/embeddings.yaml file of your LocalAI setup. Change the name from text-embedding-ada-002 to small or any other desired name.

Here are the steps to do this:

  1. Open the models/embeddings.yaml file in your LocalAI setup.
  2. Locate the configuration for the embedding model all-MiniLM-L6-v2.
  3. Change the external access name from text-embedding-ada-002 to small.

For example, the configuration might look like this:

models:
  - name: small
    path: /models/all-MiniLM-L6-v2/ggml-model-q4_0.bin
    type: embedding
  1. Save the changes and restart your LocalAI service.

After making these changes, update the Dify settings to use the new model name small and save the configuration. This should prevent the model from reverting to text-embedding-ada-002 [1].

Additionally, ensure that there are no logs or error messages generated when attempting to save the Embedding Model settings in Dify. These logs can provide more insight into why the changes are not persisting. Specifically, the update_dataset method in the DatasetService class raises ValueError exceptions with descriptive messages when certain conditions are not met [2].

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Aug 7, 2024): <!-- Answer --> The issue where the Embedding Model in the Knowledge settings of Dify version 0.6.9 reverts to "text-embedding-ada-002" after changing it to "small" and saving is likely due to the external access name configuration in LocalAI. By default, the external access name for the embedding model `all-MiniLM-L6-v2` is set to `text-embedding-ada-002`. To resolve this issue, you need to customize the external access name in the `models/embeddings.yaml` file of your LocalAI setup. Change the name from `text-embedding-ada-002` to `small` or any other desired name. Here are the steps to do this: 1. Open the `models/embeddings.yaml` file in your LocalAI setup. 2. Locate the configuration for the embedding model `all-MiniLM-L6-v2`. 3. Change the external access name from `text-embedding-ada-002` to `small`. For example, the configuration might look like this: ```yaml models: - name: small path: /models/all-MiniLM-L6-v2/ggml-model-q4_0.bin type: embedding ``` 4. Save the changes and restart your LocalAI service. After making these changes, update the Dify settings to use the new model name `small` and save the configuration. This should prevent the model from reverting to `text-embedding-ada-002` <sup>[[1]](https://github.com/langgenius/dify-docs/blob/main/en/guides/model-configuration/localai.md)</sup>. Additionally, ensure that there are no logs or error messages generated when attempting to save the Embedding Model settings in Dify. These logs can provide more insight into why the changes are not persisting. Specifically, the `update_dataset` method in the `DatasetService` class raises `ValueError` exceptions with descriptive messages when certain conditions are not met <sup>[[2]](https://github.com/langgenius/dify/blob/main/api/services/dataset_service.py)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

@dc-vin commented on GitHub (Aug 7, 2024):

Will this issue be fixed in future versions?

@dc-vin commented on GitHub (Aug 7, 2024): Will this issue be fixed in future versions?
Author
Owner

@dosubot[bot] commented on GitHub (Aug 7, 2024):

I couldn't find specific information about whether this issue will be fixed in future versions. However, you can check the release notes or changelogs for versions 0.6.10 to 0.6.16 to see if any fixes or improvements related to embedding model settings have been mentioned. If the issue persists, you might want to report it to ensure it gets addressed in upcoming releases.

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Aug 7, 2024): <!-- Answer --> I couldn't find specific information about whether this issue will be fixed in future versions. However, you can check the release notes or changelogs for versions 0.6.10 to 0.6.16 to see if any fixes or improvements related to embedding model settings have been mentioned. If the issue persists, you might want to report it to ensure it gets addressed in upcoming releases. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

@crazywoola commented on GitHub (Aug 8, 2024):

I can not reproduce this in latest version.

@crazywoola commented on GitHub (Aug 8, 2024): I can not reproduce this in latest version.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#4942