mirror of
https://github.com/open-webui/open-webui.git
synced 2026-03-11 17:47:44 -05:00
fix: normalize local CrossEncoder reranking scores for relevance threshold (#20228)
* Update utils.py * Update retrieval.py * Update utils.py * Update retrieval.py * add env var * rename to SENTENCE_TRANSFORMERS_CROSS_ENCODER_SIGMOID_ACTIVATION_FUNCTION
This commit is contained in:
@@ -762,6 +762,13 @@ else:
|
||||
except Exception:
|
||||
SENTENCE_TRANSFORMERS_CROSS_ENCODER_MODEL_KWARGS = None
|
||||
|
||||
# Whether to apply sigmoid normalization to CrossEncoder reranking scores.
|
||||
# When enabled (default), scores are normalized to 0-1 range for proper
|
||||
# relevance threshold behavior with MS MARCO models.
|
||||
SENTENCE_TRANSFORMERS_CROSS_ENCODER_SIGMOID_ACTIVATION_FUNCTION = (
|
||||
os.environ.get("SENTENCE_TRANSFORMERS_CROSS_ENCODER_SIGMOID_ACTIVATION_FUNCTION", "True").lower() == "true"
|
||||
)
|
||||
|
||||
####################################
|
||||
# OFFLINE_MODE
|
||||
####################################
|
||||
|
||||
Reference in New Issue
Block a user