From cade442259ac1fc79374c720c9406d4fc4eb4ec4 Mon Sep 17 00:00:00 2001 From: Ankit Singhal Date: Wed, 18 Oct 2023 16:44:18 -0700 Subject: [PATCH] Evalute Interface Update --- src/run.py | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/run.py b/src/run.py index 3bc0bf9..e5fb029 100644 --- a/src/run.py +++ b/src/run.py @@ -12,7 +12,7 @@ import pathlib from azure.ai.generative import AIClient -from azure.identity import DefaultAzureCredential +from azure.identity import DefaultAzureCredential, InteractiveBrowserCredential # build the index using the product catalog docs from data/3-product-info def build_cogsearch_index(index_name, path_to_data): @@ -80,22 +80,21 @@ def run_evaluation(chat_completion_fn, name, dataset_path): client = AIClient.from_config(DefaultAzureCredential()) result = evaluate( evaluation_name=name, - asset=qna_fn, + target=qna_fn, data=dataset, task_type="qa", - truth_data="truth", - metrics_config={ - "openai_params": { - "api_version": "2023-05-15", - "api_base": os.getenv("OPENAI_API_BASE"), - "api_type": "azure", - "api_key": os.getenv("OPENAI_API_KEY"), - "deployment_id": os.getenv("AZURE_OPENAI_EVALUATION_DEPLOYMENT") - }, + data_mapping={ "questions": "question", "contexts": "context", "y_pred": "answer", - "y_test": "answer" + "y_test": "truth" + }, + model_config={ + "api_version": "2023-05-15", + "api_base": os.getenv("OPENAI_API_BASE"), + "api_type": "azure", + "api_key": os.getenv("OPENAI_API_KEY"), + "deployment_id": os.getenv("AZURE_OPENAI_EVALUATION_DEPLOYMENT") }, tracking_uri=client.tracking_uri, )