mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-24 03:18:21 -05:00
[GH-ISSUE #7564] File upload Error 'NoneType' object has no attribute 'encode' #118106
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 @prasadautomationtesting on GitHub (Dec 3, 2024).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/7564
I'm encountering an error when attempting to upload files through UI, as indicated by the following message: 'NoneType object has no attribute "encode"'.
To better understand the issue, I've included some additional details below.
UI Screen print:
UI Resonse:
Backend Request:
Backend Response:
Platform: Windows 10
Browser: Chrome - 131.0.6778.86 (Official Build) (64-bit)
Open WebUI: 0.4.7
Attachment:
Note: I tried after cleaning the browser cookies as well but no luck.
@Jazzy96 commented on GitHub (Dec 4, 2024):
I have encountered it as well. v0.4.7
@Simi5599 commented on GitHub (Dec 4, 2024):
I had this error. It seems that in my case, the error was caused by the Embedding Model in the Admin Panel. I had to retype the default embedding model and then press the button on the right. After that, the error disappeared.
@prasadautomationtesting commented on GitHub (Dec 4, 2024):
@Simi5599 : It works for me too after following your workaround. Thanks!
Nevertheless, keeping the defect opened for the fix.
@Simi5599 commented on GitHub (Dec 4, 2024):
I am looking for the source code to see if i can get this to work or maybe the maintainer of the repo will do this before me ;)
@Simi5599 commented on GitHub (Dec 4, 2024):
UPDATE: I think i did it!
In the file located in
/backend/open_webui/apps/retrieval/main.pyI made the following corrections:I created a variable
default_embedding_model="sentence-transformers/all-MiniLM-L6-v2"In the function
save_docs_to_vector_dbI added the following lines at the very beginning:If the embedding model is empty i am setting it back to the default value
The code basically resets the empty
RAG_EMBEDDING_MODELto the default value stored in a variable.If @tjbck can review this, I can create a PR or let him handle the commit ;)
PROOF:
@i0ntempest commented on GitHub (Dec 6, 2024):
Apparantly this can also be triggered if the embedding model could not be downloaded due to bad network conditions.
@GrayXu commented on GitHub (Dec 23, 2024):
Sometimes I encounter this issue even without modifying the embedding model configuration, and it only returns to normal after resetting the vector database.
@silentoplayz commented on GitHub (Dec 25, 2024):
This issue has been possibly fixed on the
devbranch with this commit:4b7f0c5be1