Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
Signed-off-by: Apurva Koti <apurva.koti@databricks.com>
  • Loading branch information
apurva-koti committed May 13, 2024
1 parent 3bc13ff commit 4eef333
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions mlflow/metrics/genai/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from mlflow.metrics.genai.base import EvaluationExample
from mlflow.metrics.genai.genai_metric import make_custom_genai_metric, make_genai_metric
from mlflow.metrics.genai.genai_metric import make_genai_metric_from_prompt, make_genai_metric
from mlflow.metrics.genai.metric_definitions import (
answer_correctness,
answer_relevance,
Expand All @@ -11,7 +11,7 @@
__all__ = [
"EvaluationExample",
"make_genai_metric",
"make_custom_genai_metric",
"make_genai_metric_from_prompt",
"answer_similarity",
"answer_correctness",
"faithfulness",
Expand Down
6 changes: 3 additions & 3 deletions mlflow/metrics/genai/genai_metric.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def aggregate_function(aggregate_option, scores):


@experimental
def make_custom_genai_metric(
def make_genai_metric_from_prompt(
name: str,
judge_prompt: Optional[str] = None,
model: Optional[str] = _get_default_model(),
Expand Down Expand Up @@ -228,9 +228,9 @@ def make_custom_genai_metric(
:test:
:caption: Example for creating a genai metric
from mlflow.metrics.genai import make_custom_genai_metric
from mlflow.metrics.genai import make_genai_metric_from_prompt
metric = make_custom_genai_metric(
metric = make_genai_metric_from_prompt(
name="ease_of_understanding",
judge_prompt=(
"You must evaluate the output of a bot based on how easy it is to "
Expand Down
6 changes: 3 additions & 3 deletions tests/metrics/genai/test_genai_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from mlflow.metrics.genai.genai_metric import (
_extract_score_and_justification,
_format_args_string,
make_custom_genai_metric,
make_genai_metric_from_prompt,
make_genai_metric,
)
from mlflow.metrics.genai.metric_definitions import (
Expand Down Expand Up @@ -1066,7 +1066,7 @@ def test_make_genai_metric_metric_metadata():
def test_make_custom_judge_prompt_genai_metric():
custom_judge_prompt = "This is a custom judge prompt that uses {input} and {output}"

custom_judge_prompt_metric = make_custom_genai_metric(
custom_judge_prompt_metric = make_genai_metric_from_prompt(
name="custom",
judge_prompt=custom_judge_prompt,
metric_metadata={"metadata_field": "metadata_value"},
Expand Down Expand Up @@ -1120,7 +1120,7 @@ def test_make_custom_judge_prompt_genai_metric():
def test_make_custom_prompt_genai_metric_validates_input_kwargs():
custom_judge_prompt = "This is a custom judge prompt that uses {input} and {output}"

custom_judge_prompt_metric = make_custom_genai_metric(
custom_judge_prompt_metric = make_genai_metric_from_prompt(
name="custom",
judge_prompt=custom_judge_prompt,
)
Expand Down

0 comments on commit 4eef333

Please sign in to comment.