Skip to content

Commit a867262

Browse files
committed
replaced zava training data to make it more relevant to the question asked
1 parent fa994f6 commit a867262

File tree

4 files changed

+30
-21
lines changed

4 files changed

+30
-21
lines changed

lab/3-Custom-Politeness-Evaluator/creating-grader.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,19 +316,19 @@
316316
"Give this a score in the range of 1 to 5 where:\n",
317317
"- 1 means the answer was rude, disrespectful or dismissive\n",
318318
"- 3 means the answer was neutral, neither polite nor rude\n",
319-
"- 5 means the answer had an emoji followed by a greeting or an acknowledgement of the user question\n",
319+
"- 5 means the answer had an emoji, a warm, respectful tone; acknowledges the user or context; optional greeting; no blame or dismissiveness.\n",
320320
"\n",
321321
"### Metric 2: Is the answer helpful?\n",
322322
"\n",
323323
"Give this a score in the range of 1 to 5 where:\n",
324324
"- 1 means the response did not end with an offer to help further\n",
325325
"- 3 means the response ended with a generic offer to help\n",
326-
"- 5 means the response ended with an offer to help that was clearly related to the user's question\n",
326+
"- 5 means the response directly answers the question, provides concrete next steps/resources, ends with a specific offer to help related to the user’s need.\n",
327327
"\n",
328328
"### Metric 3: Is the answer informative?\n",
329329
"Give this a score of 0 or 1 where:\n",
330330
"- 0 means the answer did not mention any specific product or product-related fact\n",
331-
"- 1 means the answer mentioned a specific product or solution\n",
331+
"- 1 means the answer mentions a specific product/feature/policy/setting or concrete fact/step clearly relevant.\n",
332332
"\n",
333333
"### Final Score\n",
334334
"The final score you must decide should be based on a weighted blend of Metric 1 and\n",

lab/5-Distillation/adding-distillation.ipynb

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -383,16 +383,17 @@
383383
},
384384
{
385385
"cell_type": "code",
386-
"execution_count": null,
386+
"execution_count": 8,
387387
"id": "8dd907ab",
388388
"metadata": {},
389389
"outputs": [
390390
{
391391
"name": "stdout",
392392
"output_type": "stream",
393393
"text": [
394-
"👨‍🔬 Job ftjob-cc86b324d1e748f19d3d5ad21cc5f992: running\n",
395-
"⏱️ Elapsed time: 27 minutes 36 seconds\n"
394+
"👨‍🔬 Job ftjob-cc86b324d1e748f19d3d5ad21cc5f992: succeeded\n",
395+
"⏱️ Elapsed time: 48 minutes 57 seconds\n",
396+
"🏁 Fine-tuning finished!\n"
396397
]
397398
}
398399
],
@@ -461,15 +462,23 @@
461462
},
462463
{
463464
"cell_type": "code",
464-
"execution_count": null,
465+
"execution_count": 10,
465466
"id": "ca89054c",
466467
"metadata": {},
467468
"outputs": [
468469
{
469-
"name": "stdout",
470-
"output_type": "stream",
471-
"text": [
472-
"🛳️ Submitted deployment <azure.core.polling._poller.LROPoller object at 0x7593c8b7e1b0>\n"
470+
"ename": "ClientAuthenticationError",
471+
"evalue": "(InvalidAuthenticationTokenTenant) The 'EvolvedSecurityTokenService' access token is from the wrong issuer 'https://sts.windows.net/9beeb100-cd32-43ab-a787-c6e1219f6859/'. It must match the tenant 'https://sts.windows.net/3724f11b-e7b2-41d9-92a6-05ff649e1c18/' associated with this subscription. Please use the authority (URL) 'https://login.windows.net/3724f11b-e7b2-41d9-92a6-05ff649e1c18' to get the token. Note, if the subscription is transferred to another tenant there is no impact to the services, but information about new tenant could take time to propagate (up to an hour). If you just transferred your subscription and see this error message, please try back later.\nCode: InvalidAuthenticationTokenTenant\nMessage: The 'EvolvedSecurityTokenService' access token is from the wrong issuer 'https://sts.windows.net/9beeb100-cd32-43ab-a787-c6e1219f6859/'. It must match the tenant 'https://sts.windows.net/3724f11b-e7b2-41d9-92a6-05ff649e1c18/' associated with this subscription. Please use the authority (URL) 'https://login.windows.net/3724f11b-e7b2-41d9-92a6-05ff649e1c18' to get the token. Note, if the subscription is transferred to another tenant there is no impact to the services, but information about new tenant could take time to propagate (up to an hour). If you just transferred your subscription and see this error message, please try back later.",
472+
"output_type": "error",
473+
"traceback": [
474+
"\u001b[31m---------------------------------------------------------------------------\u001b[39m",
475+
"\u001b[31mClientAuthenticationError\u001b[39m Traceback (most recent call last)",
476+
"\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[10]\u001b[39m\u001b[32m, line 33\u001b[39m\n\u001b[32m 16\u001b[39m DEPLOYMENT = {\n\u001b[32m 17\u001b[39m \u001b[33m\"\u001b[39m\u001b[33mproperties\u001b[39m\u001b[33m\"\u001b[39m: {\n\u001b[32m 18\u001b[39m \u001b[33m\"\u001b[39m\u001b[33mmodel\u001b[39m\u001b[33m\"\u001b[39m: { \n\u001b[32m (...)\u001b[39m\u001b[32m 27\u001b[39m },\n\u001b[32m 28\u001b[39m }\n\u001b[32m 30\u001b[39m \u001b[38;5;66;03m# Submit the request for provisioning. This may take a few minutes, so we\u001b[39;00m\n\u001b[32m 31\u001b[39m \u001b[38;5;66;03m# poll for updates. If it already exists, this should return quickly. Since\u001b[39;00m\n\u001b[32m 32\u001b[39m \u001b[38;5;66;03m# we're deploying a 4.1-nano model, this should only take 3-5 minutes tops.\u001b[39;00m\n\u001b[32m---> \u001b[39m\u001b[32m33\u001b[39m deployment = \u001b[43mcogsvc_client\u001b[49m\u001b[43m.\u001b[49m\u001b[43mdeployments\u001b[49m\u001b[43m.\u001b[49m\u001b[43mbegin_create_or_update\u001b[49m\u001b[43m(\u001b[49m\n\u001b[32m 34\u001b[39m \u001b[43m \u001b[49m\u001b[43mresource_group_name\u001b[49m\u001b[43m=\u001b[49m\u001b[43mos\u001b[49m\u001b[43m.\u001b[49m\u001b[43menviron\u001b[49m\u001b[43m.\u001b[49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43mAZURE_RESOURCE_GROUP\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 35\u001b[39m \u001b[43m \u001b[49m\u001b[43maccount_name\u001b[49m\u001b[43m=\u001b[49m\u001b[43mos\u001b[49m\u001b[43m.\u001b[49m\u001b[43menviron\u001b[49m\u001b[43m.\u001b[49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[33;43m\"\u001b[39;49m\u001b[33;43mAZURE_AI_FOUNDRY_NAME\u001b[39;49m\u001b[33;43m\"\u001b[39;49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 36\u001b[39m \u001b[43m \u001b[49m\u001b[43mdeployment_name\u001b[49m\u001b[43m=\u001b[49m\u001b[43mDEPLOYMENT_NAME\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 37\u001b[39m \u001b[43m \u001b[49m\u001b[43mdeployment\u001b[49m\u001b[43m=\u001b[49m\u001b[43mDEPLOYMENT\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 38\u001b[39m \u001b[43m)\u001b[49m\n\u001b[32m 39\u001b[39m \u001b[38;5;28mprint\u001b[39m(\u001b[33mf\u001b[39m\u001b[33m\"\u001b[39m\u001b[33m🛳️ Submitted deployment \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mdeployment\u001b[38;5;132;01m}\u001b[39;00m\u001b[33m\"\u001b[39m)\n",
477+
"\u001b[36mFile \u001b[39m\u001b[32m~/Downloads/ignite25-PDY123-learn-how-to-observe-manage-and-scale-agentic-ai-apps-using-azure/.venv/lib/python3.13/site-packages/azure/core/tracing/decorator.py:119\u001b[39m, in \u001b[36mdistributed_trace.<locals>.decorator.<locals>.wrapper_use_tracer\u001b[39m\u001b[34m(*args, **kwargs)\u001b[39m\n\u001b[32m 117\u001b[39m \u001b[38;5;66;03m# If tracing is disabled globally and user didn't explicitly enable it, don't trace.\u001b[39;00m\n\u001b[32m 118\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m user_enabled \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mFalse\u001b[39;00m \u001b[38;5;129;01mor\u001b[39;00m (\u001b[38;5;129;01mnot\u001b[39;00m tracing_enabled \u001b[38;5;129;01mand\u001b[39;00m user_enabled \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m):\n\u001b[32m--> \u001b[39m\u001b[32m119\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mfunc\u001b[49m\u001b[43m(\u001b[49m\u001b[43m*\u001b[49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43m*\u001b[49m\u001b[43m*\u001b[49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 121\u001b[39m \u001b[38;5;66;03m# Merge span is parameter is set, but only if no explicit parent are passed\u001b[39;00m\n\u001b[32m 122\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m merge_span \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m passed_in_parent:\n",
478+
"\u001b[36mFile \u001b[39m\u001b[32m~/Downloads/ignite25-PDY123-learn-how-to-observe-manage-and-scale-agentic-ai-apps-using-azure/.venv/lib/python3.13/site-packages/azure/mgmt/cognitiveservices/operations/_deployments_operations.py:596\u001b[39m, in \u001b[36mDeploymentsOperations.begin_create_or_update\u001b[39m\u001b[34m(self, resource_group_name, account_name, deployment_name, deployment, **kwargs)\u001b[39m\n\u001b[32m 594\u001b[39m cont_token: Optional[\u001b[38;5;28mstr\u001b[39m] = kwargs.pop(\u001b[33m\"\u001b[39m\u001b[33mcontinuation_token\u001b[39m\u001b[33m\"\u001b[39m, \u001b[38;5;28;01mNone\u001b[39;00m)\n\u001b[32m 595\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m cont_token \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[32m--> \u001b[39m\u001b[32m596\u001b[39m raw_result = \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43m_create_or_update_initial\u001b[49m\u001b[43m(\u001b[49m\n\u001b[32m 597\u001b[39m \u001b[43m \u001b[49m\u001b[43mresource_group_name\u001b[49m\u001b[43m=\u001b[49m\u001b[43mresource_group_name\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 598\u001b[39m \u001b[43m \u001b[49m\u001b[43maccount_name\u001b[49m\u001b[43m=\u001b[49m\u001b[43maccount_name\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 599\u001b[39m \u001b[43m \u001b[49m\u001b[43mdeployment_name\u001b[49m\u001b[43m=\u001b[49m\u001b[43mdeployment_name\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 600\u001b[39m \u001b[43m \u001b[49m\u001b[43mdeployment\u001b[49m\u001b[43m=\u001b[49m\u001b[43mdeployment\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 601\u001b[39m \u001b[43m \u001b[49m\u001b[43mapi_version\u001b[49m\u001b[43m=\u001b[49m\u001b[43mapi_version\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 602\u001b[39m \u001b[43m \u001b[49m\u001b[43mcontent_type\u001b[49m\u001b[43m=\u001b[49m\u001b[43mcontent_type\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 603\u001b[39m \u001b[43m \u001b[49m\u001b[38;5;28;43mcls\u001b[39;49m\u001b[43m=\u001b[49m\u001b[38;5;28;43;01mlambda\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mx\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43my\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mz\u001b[49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[43mx\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 604\u001b[39m \u001b[43m \u001b[49m\u001b[43mheaders\u001b[49m\u001b[43m=\u001b[49m\u001b[43m_headers\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 605\u001b[39m \u001b[43m \u001b[49m\u001b[43mparams\u001b[49m\u001b[43m=\u001b[49m\u001b[43m_params\u001b[49m\u001b[43m,\u001b[49m\n\u001b[32m 606\u001b[39m \u001b[43m \u001b[49m\u001b[43m*\u001b[49m\u001b[43m*\u001b[49m\u001b[43mkwargs\u001b[49m\n\u001b[32m 607\u001b[39m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 608\u001b[39m raw_result.http_response.read() \u001b[38;5;66;03m# type: ignore\u001b[39;00m\n\u001b[32m 609\u001b[39m kwargs.pop(\u001b[33m\"\u001b[39m\u001b[33merror_map\u001b[39m\u001b[33m\"\u001b[39m, \u001b[38;5;28;01mNone\u001b[39;00m)\n",
479+
"\u001b[36mFile \u001b[39m\u001b[32m~/Downloads/ignite25-PDY123-learn-how-to-observe-manage-and-scale-agentic-ai-apps-using-azure/.venv/lib/python3.13/site-packages/azure/mgmt/cognitiveservices/operations/_deployments_operations.py:487\u001b[39m, in \u001b[36mDeploymentsOperations._create_or_update_initial\u001b[39m\u001b[34m(self, resource_group_name, account_name, deployment_name, deployment, **kwargs)\u001b[39m\n\u001b[32m 485\u001b[39m \u001b[38;5;28;01mexcept\u001b[39;00m (StreamConsumedError, StreamClosedError):\n\u001b[32m 486\u001b[39m \u001b[38;5;28;01mpass\u001b[39;00m\n\u001b[32m--> \u001b[39m\u001b[32m487\u001b[39m \u001b[43mmap_error\u001b[49m\u001b[43m(\u001b[49m\u001b[43mstatus_code\u001b[49m\u001b[43m=\u001b[49m\u001b[43mresponse\u001b[49m\u001b[43m.\u001b[49m\u001b[43mstatus_code\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mresponse\u001b[49m\u001b[43m=\u001b[49m\u001b[43mresponse\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43merror_map\u001b[49m\u001b[43m=\u001b[49m\u001b[43merror_map\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 488\u001b[39m error = \u001b[38;5;28mself\u001b[39m._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)\n\u001b[32m 489\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)\n",
480+
"\u001b[36mFile \u001b[39m\u001b[32m~/Downloads/ignite25-PDY123-learn-how-to-observe-manage-and-scale-agentic-ai-apps-using-azure/.venv/lib/python3.13/site-packages/azure/core/exceptions.py:163\u001b[39m, in \u001b[36mmap_error\u001b[39m\u001b[34m(status_code, response, error_map)\u001b[39m\n\u001b[32m 161\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m\n\u001b[32m 162\u001b[39m error = error_type(response=response)\n\u001b[32m--> \u001b[39m\u001b[32m163\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m error\n",
481+
"\u001b[31mClientAuthenticationError\u001b[39m: (InvalidAuthenticationTokenTenant) The 'EvolvedSecurityTokenService' access token is from the wrong issuer 'https://sts.windows.net/9beeb100-cd32-43ab-a787-c6e1219f6859/'. It must match the tenant 'https://sts.windows.net/3724f11b-e7b2-41d9-92a6-05ff649e1c18/' associated with this subscription. Please use the authority (URL) 'https://login.windows.net/3724f11b-e7b2-41d9-92a6-05ff649e1c18' to get the token. Note, if the subscription is transferred to another tenant there is no impact to the services, but information about new tenant could take time to propagate (up to an hour). If you just transferred your subscription and see this error message, please try back later.\nCode: InvalidAuthenticationTokenTenant\nMessage: The 'EvolvedSecurityTokenService' access token is from the wrong issuer 'https://sts.windows.net/9beeb100-cd32-43ab-a787-c6e1219f6859/'. It must match the tenant 'https://sts.windows.net/3724f11b-e7b2-41d9-92a6-05ff649e1c18/' associated with this subscription. Please use the authority (URL) 'https://login.windows.net/3724f11b-e7b2-41d9-92a6-05ff649e1c18' to get the token. Note, if the subscription is transferred to another tenant there is no impact to the services, but information about new tenant could take time to propagate (up to an hour). If you just transferred your subscription and see this error message, please try back later."
473482
]
474483
}
475484
],

lab/data/generator/sft_training_data.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Create a JSONL file with training samples for fine-tuning a customer service cha
1616
## Response Format Requirements
1717

1818
### 1. Response Structure (3 Parts)
19-
1. **Acknowledgment Phrase** with relevant emoji: "🎨 Perfect!", "💡 Great question!", "😞 Sorry,", "🤔 Both have benefits!"
19+
1. **Acknowledgment Phrase** optional, if present use with with relevant emoji: "🎨 Perfect!", "✅ Sounds good", "💡 Great question!", "😞 Sorry,", "🤔 Both have benefits!", "🙏 You’re welcome!"
2020
2. **Product-Specific Answer**: Product name, price, and 1-2 key benefits
2121
3. **Helpful Follow-up Offer**: Short question to continue helping
2222

@@ -88,7 +88,7 @@ Create a JSONL file with training samples for fine-tuning a customer service cha
8888

8989
## Example Variations by Stock Level
9090
- **High Stock (80+ units)**: "✨ Yes! [Product] at $X is well-stocked. [Feature]?"
91-
- **Medium Stock (20-79 units)**: "🎯 Perfect! [Product] at $X [benefit]. [Follow-up]?"
91+
- **Medium Stock (20-79 units)**: "💡 Great question! [Product] at $X [benefit]. [Follow-up]?"
9292
- **Low Stock (5-19 units)**: "😰 I'm concerned we're low with only X units. Reserve one?"
9393
- **Very Low Stock (1-4 units)**: "😔 I'm sorry, very limited with only X left. Alternative options?"
9494
- **Out of Stock (0 units)**: "😞 Sorry, [Product] is out of stock. Can I offer [Alternative] instead?"

0 commit comments

Comments
 (0)