diff --git a/dingo/model/llm/rag/llm_rag_answer_relevancy.py b/dingo/model/llm/rag/llm_rag_answer_relevancy.py index 24c7f6e0..498a9537 100644 --- a/dingo/model/llm/rag/llm_rag_answer_relevancy.py +++ b/dingo/model/llm/rag/llm_rag_answer_relevancy.py @@ -265,10 +265,10 @@ def eval(cls, input_data: Data) -> ModelRes: result = ModelRes() result.score = score - # 根据分数判断是否通过(默认阈值5,满分10分) - threshold = 5 + # 根据分数判断是否通过 + threshold = None if hasattr(cls, 'dynamic_config') and cls.dynamic_config.parameters: - threshold = cls.dynamic_config.parameters.get('threshold', 5) + threshold = cls.dynamic_config.parameters.get('threshold') # 检查是否有自定义的strictness参数 cls.strictness = cls.dynamic_config.parameters.get('strictness', 3) @@ -277,7 +277,7 @@ def eval(cls, input_data: Data) -> ModelRes: if embedding_model_name: cls.init_embedding_model(embedding_model_name) - if score >= threshold: + if threshold is None or score >= threshold: result.eval_status = False result.eval_details = { "label": ["QUALITY_GOOD.ANSWER_RELEVANCY_PASS"], diff --git a/dingo/model/llm/rag/llm_rag_context_precision.py b/dingo/model/llm/rag/llm_rag_context_precision.py index 05dd4f0f..a7255ebf 100644 --- a/dingo/model/llm/rag/llm_rag_context_precision.py +++ b/dingo/model/llm/rag/llm_rag_context_precision.py @@ -254,12 +254,12 @@ def process_response(cls, responses: List[str]) -> ModelRes: result = ModelRes() result.score = score - # 根据分数判断是否通过(默认阈值5,满分10分) - threshold = 5 + # 根据分数判断是否通过 + threshold = None if hasattr(cls, 'dynamic_config') and cls.dynamic_config.parameters: - threshold = cls.dynamic_config.parameters.get('threshold', 5) + threshold = cls.dynamic_config.parameters.get('threshold') - if score >= threshold: + if threshold is None or score >= threshold: result.eval_status = False result.eval_details = { "label": ["QUALITY_GOOD.CONTEXT_PRECISION_PASS"], diff --git a/dingo/model/llm/rag/llm_rag_context_recall.py b/dingo/model/llm/rag/llm_rag_context_recall.py index bd2e1842..ba8e7e8c 100644 --- a/dingo/model/llm/rag/llm_rag_context_recall.py +++ b/dingo/model/llm/rag/llm_rag_context_recall.py @@ -200,12 +200,12 @@ def process_response(cls, response: str) -> ModelRes: result = ModelRes() result.score = score - # 根据分数判断是否通过(默认阈值5,满分10分) - threshold = 5 + # 根据分数判断是否通过 + threshold = None if hasattr(cls, 'dynamic_config') and cls.dynamic_config.parameters: - threshold = cls.dynamic_config.parameters.get('threshold', 5) + threshold = cls.dynamic_config.parameters.get('threshold') - if score >= threshold: + if threshold is None or score >= threshold: result.eval_status = False result.eval_details = { "label": ["QUALITY_GOOD.CONTEXT_RECALL_PASS"], diff --git a/dingo/model/llm/rag/llm_rag_context_relevancy.py b/dingo/model/llm/rag/llm_rag_context_relevancy.py index 4e481add..ca5c36fa 100644 --- a/dingo/model/llm/rag/llm_rag_context_relevancy.py +++ b/dingo/model/llm/rag/llm_rag_context_relevancy.py @@ -200,12 +200,12 @@ def process_response(cls, response: str) -> ModelRes: result = ModelRes() result.score = score - # 根据分数判断是否通过(默认阈值5,满分10分) - threshold = 5 + # 根据分数判断是否通过 + threshold = None if hasattr(cls, 'dynamic_config') and cls.dynamic_config.parameters: - threshold = cls.dynamic_config.parameters.get('threshold', 5) + threshold = cls.dynamic_config.parameters.get('threshold') - if score >= threshold: + if threshold is None or score >= threshold: result.eval_status = False result.eval_details = { "label": ["QUALITY_GOOD.CONTEXT_RELEVANCY_PASS"], diff --git a/dingo/model/llm/rag/llm_rag_faithfulness.py b/dingo/model/llm/rag/llm_rag_faithfulness.py index 2ded8fac..f5fc70b0 100644 --- a/dingo/model/llm/rag/llm_rag_faithfulness.py +++ b/dingo/model/llm/rag/llm_rag_faithfulness.py @@ -284,12 +284,12 @@ def process_response(cls, response: str) -> ModelRes: result = ModelRes() result.score = score - # 根据分数判断是否通过(默认阈值5,满分10分) - threshold = 5 + # 根据分数判断是否通过 + threshold = None if hasattr(cls, 'dynamic_config') and cls.dynamic_config.parameters: - threshold = cls.dynamic_config.parameters.get('threshold', 5) + threshold = cls.dynamic_config.parameters.get('threshold') - if score >= threshold: + if threshold is None or score >= threshold: result.eval_status = False result.eval_details = { "label": ["QUALITY_GOOD.FAITHFULNESS_PASS"],