Facing problems in Azure Cloud evaluation using Python SDK
Yash Kumar
0
Reputation points
I am using Azure AI Projects and Evaluation SDK to evaluate my dataset for evaluation purpose. I am able to successfully run the code but facing issues with portal, the evaluation status is just showing "Queued" for almost 1 hour. I have followed the code provided in the document and Azure Python SDK github.
For code reproducibility:
import os, time
from azure.ai.projects import AIProjectClient
from azure.identity import DefaultAzureCredential
from azure.ai.projects.models import Evaluation, Dataset, EvaluatorConfiguration, ConnectionType
from azure.ai.evaluation import F1ScoreEvaluator, RelevanceEvaluator, ViolenceEvaluator
# Load your Azure OpenAI config
deployment_name = "gpt-4o"
api_version = "2024-08-01-preview"
project_client = AIProjectClient.from_connection_string(
credential=DefaultAzureCredential(),
conn_str=""
)
data_id = project_client.upload_file('val.jsonl')
default_connection = project_client.connections.get_default(connection_type=ConnectionType.AZURE_OPEN_AI)
model_config = default_connection.to_evaluator_model_config(deployment_name=deployment_name, api_version=api_version)
evaluators = {
"relevance": EvaluatorConfiguration(
id=RelevanceEvaluator.id,
init_params={"model_config": model_config},
data_mapping={"query": "${data.Input}", "response": "${data.Output}"},
),
}
evaluation = Evaluation(
display_name="Cloud Evaluation",
description="Cloud Evaluation of dataset",
data=Dataset(id=data_id),
evaluators=evaluators,
)
evaluation_response = project_client.evaluations.create(
evaluation=evaluation,
)
get_evaluation_response = project_client.evaluations.get(evaluation_response.id)
print("----------------------------------------------------------------")
print("Created evaluation, evaluation ID: ", get_evaluation_response.id)
print("Evaluation status: ", get_evaluation_response.status)
print("AI Foundry Portal URI: ", get_evaluation_response.properties["AiStudioEvaluationUri"])
print("----------------------------------------------------------------")
My val.jsonl looks like:
Issue with Azure Portal:
The cloud is running for more than 1+ hour.
Need some assistance for this.
Thank you.
Sign in to answer