Selaa lähdekoodia

enh: always process file with external document loader

Timothy Jaeryang Baek 4 kuukautta sitten
vanhempi
commit
3f2025dc6e
1 muutettua tiedostoa jossa 5 lisäystä ja 8 poistoa
  1. 5 8
      backend/open_webui/routers/files.py

+ 5 - 8
backend/open_webui/routers/files.py

@@ -154,14 +154,11 @@ def upload_file(
                             ProcessFileForm(file_id=id, content=result.get("text", "")),
                             user=user,
                         )
-                    elif file.content_type not in [
-                        "image/png",
-                        "image/jpeg",
-                        "image/gif",
-                        "video/mp4",
-                        "video/ogg",
-                        "video/quicktime",
-                    ]:
+                    elif (
+                        not file.content_type.startswith(("image/", "video/"))
+                        or request.app.state.config.CONTENT_EXTRACTION_ENGINE
+                        == "external"
+                    ):
                         process_file(request, ProcessFileForm(file_id=id), user=user)
                 else:
                     log.info(