Skip to content

Commit

Permalink
Fix coherence evauator
Browse files Browse the repository at this point in the history
  • Loading branch information
nick863 committed Apr 16, 2024
1 parent f43302d commit e04f9a0
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

__path__ = __import__("pkgutil").extend_path(__path__, __name__) # type: ignore

from typing import Optional

from pathlib import Path

from promptflow.client import load_flow
Expand All @@ -12,12 +14,15 @@


class CoherenceEvaluator:
def __init__(self, model_config: AzureOpenAIModelConfiguration):
def __init__(self, model_config: AzureOpenAIModelConfiguration,
log_level: Optional[int] = None):
"""
Initialize an evaluator configured for a specific Azure OpenAI model.
:param model_config: Configuration for the Azure OpenAI model.
:type model_config: AzureOpenAIModelConfiguration
:param log_level: The logging level.
:type log_level: Optional[int]
**Usage**
Expand All @@ -32,7 +37,7 @@ def __init__(self, model_config: AzureOpenAIModelConfiguration):
# Load the flow as function
current_dir = Path(__file__).resolve().parent
flow_dir = current_dir / "flow"
self._flow = load_flow(source=flow_dir)
self._flow = load_flow(source=flow_dir, log_level=log_level)

# Override the connection
connection = convert_model_configuration_to_connection(model_config)
Expand Down

0 comments on commit e04f9a0

Please sign in to comment.