Skip to content

Commit 9194700

Browse files
ninghuneeduv
authored andcommitted
Evaluation: Remove parallel from composite evaluators (Azure#38168)
* Remove `parallel` from composite evaluators * update recording * update * output_dir check * fix the test recording * fix the failed unit-test * update changelog * update * fix black issue * revert output_path related change * Update sdk/evaluation/azure-ai-evaluation/CHANGELOG.md Co-authored-by: Neehar Duvvuri <[email protected]> --------- Co-authored-by: Neehar Duvvuri <[email protected]>
1 parent b7ef4e5 commit 9194700

File tree

9 files changed

+19
-340
lines changed

9 files changed

+19
-340
lines changed

sdk/evaluation/azure-ai-evaluation/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
### Features Added
66

77
### Breaking Changes
8+
- The `parallel` parameter has been removed from composite evaluators: `QAEvaluator`, `ContentSafetyChatEvaluator`, and `ContentSafetyMultimodalEvaluator`. To control evaluator parallelism, you can now use the `_parallel` keyword argument, though please note that this private parameter may change in the future.
89

910
### Bugs Fixed
1011
- Output of adversarial simulators are of type `JsonLineList` and the helper function `to_eval_qr_json_lines` now outputs context from both user and assistant turns along with `category` if it exists in the conversation

sdk/evaluation/azure-ai-evaluation/assets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"AssetsRepo": "Azure/azure-sdk-assets",
33
"AssetsRepoPrefixPath": "python",
44
"TagPrefix": "python/evaluation/azure-ai-evaluation",
5-
"Tag": "python/evaluation/azure-ai-evaluation_e3ec13551e"
5+
"Tag": "python/evaluation/azure-ai-evaluation_daf1ed16fc"
66
}

sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluate/_telemetry/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ def wrapper(*args: P.args, **kwargs: P.kwargs) -> EvaluationResult:
123123
user_agent=USER_AGENT,
124124
)
125125

126-
track_in_cloud = bool(pf_client._config.get_trace_destination()) # pylint: disable=protected-access
126+
trace_destination = pf_client._config.get_trace_destination() # pylint: disable=protected-access
127+
track_in_cloud = bool(trace_destination) if trace_destination != "none" else False
127128
evaluate_target = bool(kwargs.get("target", None))
128129
evaluator_config = bool(kwargs.get("evaluator_config", None))
129130
custom_dimensions: Dict[str, Union[str, bool]] = {

sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_content_safety/_content_safety.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class ContentSafetyEvaluator(EvaluatorBase[Union[str, float]]):
7171
# TODO address 3579092 to re-enabled parallel evals.
7272
def __init__(self, credential, azure_ai_project, eval_last_turn: bool = False, **kwargs):
7373
super().__init__(eval_last_turn=eval_last_turn)
74-
self._parallel = kwargs.pop("parallel", False)
74+
self._parallel = kwargs.pop("_parallel", False)
7575
self._evaluators: List[Callable[..., Dict[str, Union[str, float]]]] = [
7676
ViolenceEvaluator(credential, azure_ai_project),
7777
SexualEvaluator(credential, azure_ai_project),

sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_content_safety/_content_safety_chat.py

Lines changed: 0 additions & 322 deletions
This file was deleted.

sdk/evaluation/azure-ai-evaluation/azure/ai/evaluation/_evaluators/_multimodal/_content_safety_multimodal.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,8 @@ class ContentSafetyMultimodalEvaluator:
2828
:param azure_ai_project: The scope of the Azure AI project, containing the subscription ID,
2929
resource group, and project name.
3030
:type azure_ai_project: ~azure.ai.evaluation.AzureAIProject
31-
:param parallel: Specifies whether to use parallel execution for evaluators.
32-
If True, evaluators execute in parallel; otherwise, they execute sequentially. Defaults to True.
33-
:type parallel: bool
31+
:param kwargs: Additional arguments to pass to the evaluator.
32+
:type kwargs: Any
3433
3534
:return: A function that evaluates multimodal chat messages and generates content safety metrics.
3635
:rtype: Callable
@@ -92,8 +91,8 @@ class ContentSafetyMultimodalEvaluator:
9291
9392
"""
9493

95-
def __init__(self, credential, azure_ai_project, parallel: bool = False):
96-
self._parallel = parallel
94+
def __init__(self, credential, azure_ai_project, **kwargs):
95+
self._parallel = kwargs.pop("_parallel", False)
9796
self._evaluators: List[Callable[..., Dict[str, Union[str, float]]]] = [
9897
ViolenceMultimodalEvaluator(credential=credential, azure_ai_project=azure_ai_project),
9998
SexualMultimodalEvaluator(credential=credential, azure_ai_project=azure_ai_project),

0 commit comments

Comments
 (0)