Skip to content

Commit

Permalink
updating to version 0.3.35
Browse files Browse the repository at this point in the history
  • Loading branch information
oznav2 committed Oct 28, 2024
1 parent 4914534 commit 0cbe247
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions backend/open_webui/apps/retrieval/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,22 +175,37 @@
app.state.config.RAG_WEB_SEARCH_CONCURRENT_REQUESTS = RAG_WEB_SEARCH_CONCURRENT_REQUESTS


# def update_embedding_model(
# embedding_model: str,
# auto_update: bool = False,
# ):
# if embedding_model and app.state.config.RAG_EMBEDDING_ENGINE == "":
# from sentence_transformers import SentenceTransformer

# app.state.sentence_transformer_ef = SentenceTransformer(
# get_model_path(embedding_model, auto_update),
# device=DEVICE_TYPE,
# trust_remote_code=RAG_EMBEDDING_MODEL_TRUST_REMOTE_CODE,
# )
# else:
# app.state.sentence_transformer_ef = None

# reverting to old version of this function
def update_embedding_model(
embedding_model: str,
auto_update: bool = False,
):
if embedding_model and app.state.config.RAG_EMBEDDING_ENGINE == "":
from sentence_transformers import SentenceTransformer
import sentence_transformers

app.state.sentence_transformer_ef = SentenceTransformer(
app.state.sentence_transformer_ef = sentence_transformers.SentenceTransformer(
get_model_path(embedding_model, auto_update),
device=DEVICE_TYPE,
trust_remote_code=RAG_EMBEDDING_MODEL_TRUST_REMOTE_CODE,
)
else:
app.state.sentence_transformer_ef = None


def update_reranking_model(
reranking_model: str,
auto_update: bool = False,
Expand Down

0 comments on commit 0cbe247

Please sign in to comment.