Browse Source

Add check if images and avoid trying to calculate embeddings

Rodrigo Agundez 4 months ago
parent
commit
ac321f4b64
1 changed files with 1 additions and 1 deletions
  1. 1 1
      backend/open_webui/routers/files.py

+ 1 - 1
backend/open_webui/routers/files.py

@@ -81,7 +81,7 @@ def upload_file(
                     ProcessFileForm(file_id=id, content=result.get("text", "")),
                     user=user,
                 )
-            else:
+            elif file.content_type not in ["image/png", "image/jpeg", "image/gif"]:
                 process_file(request, ProcessFileForm(file_id=id), user=user)
 
             file_item = Files.get_file_by_id(id=id)