From 36ae0e54768cef9bc4e2e8439a6391cbe28337ee Mon Sep 17 00:00:00 2001 From: Fei He Date: Wed, 12 Mar 2025 20:55:57 +0800 Subject: [PATCH] fix: set score_threshold only when score_threshold_enabled is true. (#14221) --- api/core/app/app_config/easy_ui_based_app/dataset/manager.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/core/app/app_config/easy_ui_based_app/dataset/manager.py b/api/core/app/app_config/easy_ui_based_app/dataset/manager.py index 646c4badb9..a1a65e2287 100644 --- a/api/core/app/app_config/easy_ui_based_app/dataset/manager.py +++ b/api/core/app/app_config/easy_ui_based_app/dataset/manager.py @@ -89,7 +89,9 @@ class DatasetConfigManager: dataset_configs["retrieval_model"] ), top_k=dataset_configs.get("top_k", 4), - score_threshold=dataset_configs.get("score_threshold"), + score_threshold=dataset_configs.get("score_threshold") + if dataset_configs.get("score_threshold_enabled", False) + else None, reranking_model=dataset_configs.get("reranking_model"), weights=dataset_configs.get("weights"), reranking_enabled=dataset_configs.get("reranking_enabled", True),