mirror of
https://github.com/open-webui/open-webui
synced 2024-11-16 05:24:02 +00:00
refac: better reranking model error handling
This commit is contained in:
parent
2f9f568dd9
commit
869063c743
@ -195,11 +195,16 @@ def update_reranking_model(
|
|||||||
if reranking_model:
|
if reranking_model:
|
||||||
import sentence_transformers
|
import sentence_transformers
|
||||||
|
|
||||||
app.state.sentence_transformer_rf = sentence_transformers.CrossEncoder(
|
try:
|
||||||
get_model_path(reranking_model, update_model),
|
app.state.sentence_transformer_rf = sentence_transformers.CrossEncoder(
|
||||||
device=DEVICE_TYPE,
|
get_model_path(reranking_model, update_model),
|
||||||
trust_remote_code=RAG_RERANKING_MODEL_TRUST_REMOTE_CODE,
|
device=DEVICE_TYPE,
|
||||||
)
|
trust_remote_code=RAG_RERANKING_MODEL_TRUST_REMOTE_CODE,
|
||||||
|
)
|
||||||
|
except:
|
||||||
|
log.error("CrossEncoder error")
|
||||||
|
app.state.sentence_transformer_rf = None
|
||||||
|
app.state.config.ENABLE_RAG_HYBRID_SEARCH = False
|
||||||
else:
|
else:
|
||||||
app.state.sentence_transformer_rf = None
|
app.state.sentence_transformer_rf = None
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user