Timothy Jaeryang Baek 3 meses atrás
pai
commit
eb68b21e0f
2 arquivos alterados com 7 adições e 7 exclusões
  1. 6 6
      backend/open_webui/main.py
  2. 1 1
      backend/open_webui/utils/plugin.py

+ 6 - 6
backend/open_webui/main.py

@@ -383,7 +383,7 @@ from open_webui.utils.auth import (
     get_admin_user,
     get_verified_user,
 )
-from open_webui.utils.plugin import install_admin_tool_and_function_dependencies
+from open_webui.utils.plugin import install_tool_and_function_dependencies
 from open_webui.utils.oauth import OAuthManager
 from open_webui.utils.security_headers import SecurityHeadersMiddleware
 
@@ -446,6 +446,11 @@ async def lifespan(app: FastAPI):
     if LICENSE_KEY:
         get_license_data(app, LICENSE_KEY)
 
+    # This should be blocking (sync) so functions are not deactivated on first /get_models calls
+    # when the first user lands on the / route.
+    log.info("Installing external dependencies of functions and tools...")
+    install_tool_and_function_dependencies()
+
     pool_size = THREAD_POOL_SIZE
     if pool_size and pool_size > 0:
         limiter = anyio.to_thread.current_default_thread_limiter()
@@ -453,11 +458,6 @@ async def lifespan(app: FastAPI):
 
     asyncio.create_task(periodic_usage_pool_cleanup())
 
-    # This should be blocking (sync) so functions are not deactivated on first /get_models calls
-    # when the first user lands on the / route.
-    log.info("Installing external dependencies of functions and tools...")
-    install_admin_tool_and_function_dependencies()
-
     yield
 
 

+ 1 - 1
backend/open_webui/utils/plugin.py

@@ -185,7 +185,7 @@ def install_frontmatter_requirements(requirements: str):
         log.info("No requirements found in frontmatter.")
 
 
-def install_admin_tool_and_function_dependencies():
+def install_tool_and_function_dependencies():
     """
     Install all dependencies for all admin tools and active functions.