@@ -50,12 +50,13 @@ If this is your first time running evaluations and logging it to your Azure AI F
50
50
``` python
51
51
import os
52
52
53
- Required environment variables:
54
- endpoint = os.environ[" PROJECT_ENDPOINT" ] https:// < account> .services.ai.azure.com/ api/ projects/ < project>
55
- model_endpoint = os.environ[" MODEL_ENDPOINT" ] https:// < account> .services.ai.azure.com
56
- model_api_key = os.environ[" MODEL_API_KEY" ]
53
+ # Required environment variables:
54
+ endpoint = os.environ[" PROJECT_ENDPOINT" ] # https://<account>.services.ai.azure.com/api/projects/<project>
55
+ model_endpoint = os.environ[" MODEL_ENDPOINT" ] # https://<account>.services.ai.azure.com
56
+ model_api_key = os.environ[" MODEL_API_KEY" ]
57
+ model_deployment_name = os.environ[" MODEL_DEPLOYMENT_NAME" ] # E.g. gpt-4o-mini
57
58
58
- Optional: Reuse an existing dataset.
59
+ # Optional: Reuse an existing dataset.
59
60
dataset_name = os.environ.get(" DATASET_NAME" , " dataset-test" )
60
61
dataset_version = os.environ.get(" DATASET_VERSION" , " 1.0" )
61
62
```
@@ -162,7 +163,7 @@ from azure.ai.ml import MLClient
162
163
from azure.ai.ml.entities import Model
163
164
from promptflow.client import PFClient
164
165
165
- # Define ` ml_client` to register the custom evaluator.
166
+ # Define ml_client to register the custom evaluator.
166
167
ml_client = MLClient(
167
168
subscription_id = os.environ[" AZURE_SUBSCRIPTION_ID" ],
168
169
resource_group_name = os.environ[" AZURE_RESOURCE_GROUP" ],
@@ -213,15 +214,15 @@ model_config = dict(
213
214
type = " azure_openai"
214
215
)
215
216
216
- # Define ` ml_client` to register the custom evaluator.
217
+ # Define ml_client to register the custom evaluator.
217
218
ml_client = MLClient(
218
219
subscription_id = os.environ[" AZURE_SUBSCRIPTION_ID" ],
219
220
resource_group_name = os.environ[" AZURE_RESOURCE_GROUP" ],
220
221
workspace_name = os.environ[" AZURE_PROJECT_NAME" ],
221
222
credential = DefaultAzureCredential()
222
223
)
223
224
224
- # Convert the evaluator to evaluation flow and save it locally.
225
+ # # Convert the evaluator to evaluation flow and save it locally.
225
226
local_path = " friendliness_local"
226
227
pf_client = PFClient()
227
228
pf_client.flows.save(entry = FriendlinessEvaluator, path = local_path)
0 commit comments