mirror of
https://github.com/open-webui/open-webui.git
synced 2026-03-14 11:05:45 -05:00
feat: allow deleting uploaded files #509
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 @leobenkel on GitHub (Mar 20, 2024).
Originally assigned to: @tjbck on GitHub.
Bug Report
Description
Bug Summary:
It looks like that when a document is removed through the UI, the file stays on disk.
Steps to Reproduce:
Upload a document, then remove it.
Go check the upload directory and the document is still here.
Expected Behavior:
Document should be cleaned if nothing in the UI need it anymore (no chat, no document)
Actual Behavior:
Document stays on disk
Reproduction Details
Confirmation:
Installation Method
docker
@jannikstdl commented on GitHub (Mar 20, 2024):
That indeed is a problem if any user uploads a doc in the chat and then you change the embedding model you can't use them anymore because the vectorestores of this files with an uniquely are still in the data dir but they were made with the old embedding model which the new one can't read.
@tjbck commented on GitHub (Mar 20, 2024):
This is intended for admins to monitor what's being uploaded to the webui, but I agree we should have the option to clear the upload directory. Feel free to make a PR!
@leobenkel commented on GitHub (Mar 21, 2024):
also for privacy reason, if one user wants to remove their file. it should not stay around on the server side.
@raetsch commented on GitHub (May 6, 2024):
I would also like to add, that there seems to be a bug, that when you tried to delete a document and want to reupload it (with different embedding or chunking params), you get an error message from chroma that collection is already present. only complete reset of vector store is currently fixing that.
2024-05-06 10:05:46 ERROR:apps.rag.main:Collection a306bf8fac91dba35a51d1eae7acbbff768e709c447684733365d0efecdb305 already exists 2024-05-06 10:05:46 Traceback (most recent call last): 2024-05-06 10:05:46 File "/app/backend/apps/rag/main.py", line 582, in store_docs_in_vector_db 2024-05-06 10:05:46 collection = CHROMA_CLIENT.create_collection(name=collection_name) 2024-05-06 10:05:46 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-05-06 10:05:46 File "/usr/local/lib/python3.11/site-packages/chromadb/api/client.py", line 198, in create_collection 2024-05-06 10:05:46 return self._server.create_collection( 2024-05-06 10:05:46 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-05-06 10:05:46 File "/usr/local/lib/python3.11/site-packages/chromadb/telemetry/opentelemetry/__init__.py", line 127, in wrapper 2024-05-06 10:05:46 return f(*args, **kwargs) 2024-05-06 10:05:46 ^^^^^^^^^^^^^^^^^^ 2024-05-06 10:05:46 File "/usr/local/lib/python3.11/site-packages/chromadb/api/segment.py", line 167, in create_collection 2024-05-06 10:05:46 coll, created = self._sysdb.create_collection( 2024-05-06 10:05:46 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2024-05-06 10:05:46 File "/usr/local/lib/python3.11/site-packages/chromadb/telemetry/opentelemetry/__init__.py", line 127, in wrapper 2024-05-06 10:05:46 return f(*args, **kwargs) 2024-05-06 10:05:46 ^^^^^^^^^^^^^^^^^^ 2024-05-06 10:05:46 File "/usr/local/lib/python3.11/site-packages/chromadb/db/mixins/sysdb.py", line 225, in create_collection 2024-05-06 10:05:46 raise UniqueConstraintError(f"Collection {name} already exists") 2024-05-06 10:05:46 chromadb.db.base.UniqueConstraintError: Collection a306bf8fac91dba35a51d1eae7acbbff768e709c447684733365d0efecdb305 already existsOpen WebUI Version
v0.1.123 (latest)
@tjbck commented on GitHub (Jun 4, 2024):
Added on dev!