-
Notifications
You must be signed in to change notification settings - Fork 65
fix : delete threshold for 5 metrics #275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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') | ||
|
Comment on lines
+258
to
+260
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| if score >= threshold: | ||
| if threshold is None or score >= threshold: | ||
| result.eval_status = False | ||
| result.eval_details = { | ||
| "label": ["QUALITY_GOOD.CONTEXT_PRECISION_PASS"], | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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') | ||
|
Comment on lines
+204
to
+206
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| if score >= threshold: | ||
| if threshold is None or score >= threshold: | ||
| result.eval_status = False | ||
| result.eval_details = { | ||
| "label": ["QUALITY_GOOD.CONTEXT_RECALL_PASS"], | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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') | ||
|
Comment on lines
+204
to
+206
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| if score >= threshold: | ||
| if threshold is None or score >= threshold: | ||
| result.eval_status = False | ||
| result.eval_details = { | ||
| "label": ["QUALITY_GOOD.CONTEXT_RELEVANCY_PASS"], | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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') | ||
|
Comment on lines
+288
to
+290
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| if score >= threshold: | ||
| if threshold is None or score >= threshold: | ||
| result.eval_status = False | ||
| result.eval_details = { | ||
| "label": ["QUALITY_GOOD.FAITHFULNESS_PASS"], | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
为了提高代码可读性并避免重复访问属性,建议将
cls.dynamic_config.parameters存入一个局部变量中。这样后续对参数的访问会更简洁,也方便您在后续代码(如276行)中复用该变量。