mirror of
https://github.com/open-webui/open-webui
synced 2024-11-28 23:13:30 +00:00
Merge pull request #5878 from cheahjs/feat/lazy-load-new-imports-for-mem
perf: lazy load big dependencies to reduce min memory usage
This commit is contained in:
commit
f19b61307d
@ -15,9 +15,6 @@ from pydantic import BaseModel
|
||||
|
||||
from open_webui.apps.retrieval.vector.connector import VECTOR_DB_CLIENT
|
||||
|
||||
# Information retrieval models
|
||||
from open_webui.apps.retrieval.models.colbert import ColBERT
|
||||
|
||||
# Document loaders
|
||||
from open_webui.apps.retrieval.loaders.main import Loader
|
||||
|
||||
@ -192,6 +189,8 @@ def update_reranking_model(
|
||||
if reranking_model:
|
||||
if any(model in reranking_model for model in ["jinaai/jina-colbert-v2"]):
|
||||
try:
|
||||
from open_webui.apps.retrieval.models.colbert import ColBERT
|
||||
|
||||
app.state.sentence_transformer_rf = ColBERT(
|
||||
get_model_path(reranking_model, auto_update),
|
||||
env="docker" if DOCKER else None,
|
||||
|
@ -1,10 +1,10 @@
|
||||
from open_webui.apps.retrieval.vector.dbs.chroma import ChromaClient
|
||||
from open_webui.apps.retrieval.vector.dbs.milvus import MilvusClient
|
||||
|
||||
|
||||
from open_webui.config import VECTOR_DB
|
||||
|
||||
if VECTOR_DB == "milvus":
|
||||
from open_webui.apps.retrieval.vector.dbs.milvus import MilvusClient
|
||||
|
||||
VECTOR_DB_CLIENT = MilvusClient()
|
||||
else:
|
||||
from open_webui.apps.retrieval.vector.dbs.chroma import ChromaClient
|
||||
|
||||
VECTOR_DB_CLIENT = ChromaClient()
|
||||
|
Loading…
Reference in New Issue
Block a user