Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix black errors
  • Loading branch information
needuv committed Oct 29, 2024
commit d3aacc191e3e79923b01ee7213f34a528f3e4c02
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,11 @@


@overload
def experimental(wrapped: Type[T]) -> Type[T]:
...
def experimental(wrapped: Type[T]) -> Type[T]: ...


@overload
def experimental(wrapped: Callable[P, T]) -> Callable[P, T]:
...
def experimental(wrapped: Callable[P, T]) -> Callable[P, T]: ...


def experimental(wrapped: Union[Type[T], Callable[P, T]]) -> Union[Type[T], Callable[P, T]]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def __call__(
"""

@override
def __call__(
def __call__( # pylint: disable=docstring-missing-param
self,
*args,
**kwargs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,11 @@ def __init__(
# This needs to be overridden just to change the function header into something more informative,
# and to be able to add a more specific docstring. The actual function contents should just be
# super().__call__(<inputs>)
def __call__(self, *args, **kwargs) -> Union[DoEvalResult[T_EvalValue], AggregateResult[T_EvalValue]]:
def __call__( # pylint: disable=docstring-missing-param
self,
*args,
**kwargs,
) -> Union[DoEvalResult[T_EvalValue], AggregateResult[T_EvalValue]]:
"""Evaluate a given input. This method serves as a wrapper and is meant to be overridden by child classes for
one main reason - to overwrite the method headers and docstring to include additional inputs as needed.
The actual behavior of this function shouldn't change beyond adding more inputs to the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def __init__(
self._credential = credential

@override
def __call__(
def __call__( # pylint: disable=docstring-missing-param
self,
*args,
**kwargs,
Expand Down Expand Up @@ -105,7 +105,7 @@ async def _do_eval(self, eval_input: Dict) -> Dict[str, T]:
)
input_data["context"] = context

return await evaluate_with_rai_service(
return await evaluate_with_rai_service( # type: ignore
metric_name=self._eval_metric,
data=input_data,
project_scope=self._azure_ai_project,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def __call__(
"""

@override
def __call__(
def __call__( # pylint: disable=docstring-missing-param
self,
*args,
**kwargs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def __call__(
"""

@override
def __call__(
def __call__( # pylint: disable=docstring-missing-param
self,
*args,
**kwargs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def __call__(
"""

@override
def __call__(
def __call__( # pylint: disable=docstring-missing-param
self,
*args,
**kwargs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def __call__(
"""

@override
def __call__(
def __call__( # pylint: disable=docstring-missing-param
self,
*args,
**kwargs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def __call__(
"""

@override
def __call__(
def __call__( # pylint: disable=docstring-missing-param
self,
*args,
**kwargs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def __call__(
"""

@override
def __call__(
def __call__( # pylint: disable=docstring-missing-param
self,
*args,
**kwargs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def __call__(
"""

@override
def __call__(
def __call__( # pylint: disable=docstring-missing-param
self,
*args,
**kwargs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def __call__(self, *, query: str, response: str, context: str, ground_truth: str
:return: The scores for QA scenario.
:rtype: Dict[str, Union[str, float]]
"""
results: Dict[str, float] = {}
results: Dict[str, Union[str, float]] = {}
if self._parallel:
with ThreadPoolExecutor() as executor:
futures = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def __call__(
"""

@override
def __call__(
def __call__( # pylint: disable=docstring-missing-param
self,
*args,
**kwargs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def __call__(
:rtype: :rtype: Dict[str, Union[float, Dict[str, List[float]]]]
"""

def __call__(self, *args, **kwargs):
def __call__(self, *args, **kwargs): # pylint: disable=docstring-missing-param
"""Evaluates retrieval score chat scenario. Accepts either a query and context for a single evaluation,
or a conversation for a multi-turn evaluation. If the conversation has more than one turn,
the evaluator will aggregate the results of each turn.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def __call__(
*,
conversation: Conversation,
) -> Dict[str, Union[float, Dict[str, List[Union[str, bool]]]]]:
"""Evaluate groundednessf for a conversation for a multi-turn evaluation. If the conversation has
"""Evaluate groundedness for a conversation for a multi-turn evaluation. If the conversation has
more than one turn, the evaluator will aggregate the results of each turn, with the per-turn results
available in the output under the "evaluation_per_turn" key.

Expand All @@ -140,7 +140,7 @@ def __call__(
"""

@override
def __call__(
def __call__( # pylint: disable=docstring-missing-param
self,
*args,
**kwargs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def __call__(
"""

@override
def __call__(
def __call__( # pylint: disable=docstring-missing-param
self,
*args,
**kwargs,
Expand Down