mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 19:08:59 -05:00
[GH-ISSUE #9909] Failed to upload and add text content to the knowledge base #31223
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 @oldmale on GitHub (Feb 13, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/9909
I used file upload when creating the knowledge base, and the file name is api.txt
#Company Technical Documents
1. system architecture
Our system adopts a microservice architecture, where each service module runs independently and interacts with each other through APIs.
2. Database Design
The database uses MySQL to store all user data, and the table structure is as follows:
-User Table: id, name, email
-Product List: id, name, price
3. API Design
All APIs adopt RESTful style, and the following are common interfaces:
-GET/users: Get all users
-POST/products: Add new products
return:
"hash": null,
"filename": "api.txt",
"data": {},
"meta": {
"name": "api.txt",
"content_type": "text/plain",
"size": 470,
"data": {}
},
"created_at": 1739456988,
"updated_at": 1739456988,
"path": "/home/hxm/anaconda3/envs/ollama/lib/python3.12/site-packages/open_webui/data/uploads/a0f742be-7547-45e5-8ec8-7336007e9cc6_api.txt",
"access_control": null,
"error": "'NoneType' object has no attribute 'encode'"
}
ERROR [open_webui.routers.retrieval] 'NoneType' object has no attribute 'encode'
Traceback (most recent call last):
File "/home/hxm/anaconda3/envs/ollama/lib/python3.12/site-packages/open_webui/routers/retrieval.py", line 974, in process_file
raise e
File "/home/hxm/anaconda3/envs/ollama/lib/python3.12/site-packages/open_webui/routers/retrieval.py", line 946, in process_file
result = save_docs_to_vector_db(
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/hxm/anaconda3/envs/ollama/lib/python3.12/site-packages/open_webui/routers/retrieval.py", line 819, in save_docs_to_vector_db
raise e
File "/home/hxm/anaconda3/envs/ollama/lib/python3.12/site-packages/open_webui/routers/retrieval.py", line 797, in save_docs_to_vector_db
embeddings = embedding_function(
^^^^^^^^^^^^^^^^^^^
File "/home/hxm/anaconda3/envs/ollama/lib/python3.12/site-packages/open_webui/retrieval/utils.py", line 265, in
return lambda query, user=None: embedding_function.encode(query).tolist()
^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'encode'
I don't know how to solve this problem, can you help me take a look.Thank you!