Encountered an error while using ZhipuAI's text-embedding model in Dify. #887

Closed
opened 2026-02-21 17:28:52 -05:00 by yindo · 2 comments
Owner

Originally created by @guyfar on GitHub (Jan 10, 2024).

Originally assigned to: @JohnJyong on GitHub.

Self Checks

Dify version

0.4.4

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

The error message when using ZhipuAi's text-embedding model is shown in the following image.

WechatIMG499

✔️ Expected Behavior

I suspect it's caused by not using ZhipuAiTokenizer to get the number of tokens in the text_embedding.py of ZhipuAi, as shown in the following image.

SCR-20240110-keld

Actual Behavior

No response

Originally created by @guyfar on GitHub (Jan 10, 2024). Originally assigned to: @JohnJyong on GitHub. ### Self Checks - [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 file this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). ### Dify version 0.4.4 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce The error message when using ZhipuAi's text-embedding model is shown in the following image. ![WechatIMG499](https://github.com/langgenius/dify/assets/3032483/96b204f2-4940-4202-9f92-c831d0edfdd5) ### ✔️ Expected Behavior I suspect it's caused by not using ZhipuAiTokenizer to get the number of tokens in the text_embedding.py of ZhipuAi, as shown in the following image. <img width="948" alt="SCR-20240110-keld" src="https://github.com/langgenius/dify/assets/3032483/85600393-d57a-4723-92ac-e5f3cd58899c"> ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug label 2026-02-21 17:28:52 -05:00
yindo closed this issue 2026-02-21 17:28:52 -05:00
Author
Owner

@jinghao2eebd commented on GitHub (Jan 10, 2024):

same problem

@jinghao2eebd commented on GitHub (Jan 10, 2024): same problem
Author
Owner

@crazywoola commented on GitHub (Jan 10, 2024):

We fixed this yesterday in this https://github.com/langgenius/dify/pull/1976/files
It will be released in v0.4.5
-- Update --
Unless you are using Self hosted(source). Otherwise it will be fixed in next release. or you can use that commit id to start the application.

@crazywoola commented on GitHub (Jan 10, 2024): We fixed this yesterday in this https://github.com/langgenius/dify/pull/1976/files It will be released in v0.4.5 -- Update -- Unless you are using Self hosted(source). Otherwise it will be fixed in next release. or you can use that commit id to start the application.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#887