mirror of
https://github.com/langgenius/dify-official-plugins.git
synced 2026-07-21 17:45:23 -04:00
PluginInvokeError with Hugging Face in Dify: Pydantic Validation Error (EmbeddingUsage expects integer instead of list) #173
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @fukuda-masayuki on GitHub (Apr 5, 2025).
Self Checks
Dify version
1.1.3
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
Error Details
Issue Overview
When registering knowledge and selecting a Hugging Face-provided Text Embedding model, the above error occurs.
Steps to Reproduce
Register the Hugging Face HF inference API model as a Text Embedding model.
Begin the knowledge registration process.
Apply the Hugging Face model to the embedding settings.
Finalize the knowledge registration.
✔️ Expected Behavior
No response
❌ Actual Behavior
No response
@dosubot[bot] commented on GitHub (Apr 5, 2025):
Hello @fukuda-masayuki! 👋 I'm Dosu, a friendly bot here to help you solve bugs, answer questions, and become a contributor. I'm ready to assist while you wait for a human maintainer. Let's tackle this together! 🚀
I found a similar closed issue titled "docker-compose launched project conversion embedding error" which might be related to the error you're encountering. This issue was last updated on October 31, 2024, and was referenced by another issue titled "Failed to format qa document" which was last updated on February 28, 2025. However, the issue does not have any comments, so there might not be a direct solution provided there [1].
The error you're experiencing seems to be related to a Pydantic validation error where an integer is expected, but a list is provided. You might want to check the data being passed to the
EmbeddingUsagemodel and ensure that the values fortokensandtotal_tokensare integers instead of lists.To continue talking to Dosu, mention @dosu.
Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other