|
2 | 2 | "cells": [ |
3 | 3 | { |
4 | 4 | "cell_type": "markdown", |
| 5 | + "id": "0", |
5 | 6 | "metadata": { |
6 | 7 | "lines_to_next_cell": 0 |
7 | 8 | }, |
|
26 | 27 | " - This deployment name can be acquired from the Azure ML managed online endpoint, as illustrated in image below.\n", |
27 | 28 | " <br> <img src=\"./../../assets/aml_deployment_name.png\" alt=\"AML Deployment Name\" height=\"400\"/> <br>\n", |
28 | 29 | "\n", |
29 | | - "2. **AZURE_ML_SCORE_URI**\n", |
30 | | - " - To obtain the score URI, navigate through the Azure ML workspace by selecting 'Launch Studio', then 'Endpoints' on the left side, followed by 'Consume'. Copy the REST endpoint as depicted below.\n", |
| 30 | + "2. **AZURE_ML_MANAGED_ENDPOINT**\n", |
| 31 | + " - To obtain the managed endpoint, navigate through the Azure ML workspace by selecting 'Launch Studio', then 'Endpoints' on the left side, followed by 'Consume'. Copy the REST endpoint as depicted below.\n", |
31 | 32 | " <br> <img src=\"./../../assets/aml_score_uri.png\" alt=\"AML Score URI\" height=\"400\"/> <br>\n", |
32 | 33 | "\n", |
33 | | - "3. **AZURE_ML_SCORE_API_KEY**\n", |
| 34 | + "3. **AZURE_ML_KEY**\n", |
34 | 35 | " - Navigate through the Azure ML workspace by selecting 'Launch Studio', then 'Endpoints' on the left side, followed by 'Consume'. The primary key can be obtained as shown in the subsequent image.\n", |
35 | 36 | " <br> <img src=\"./../../assets/aml_score_key.png\" alt=\"AML Score Key\" height=\"400\"/> <br>\n", |
36 | 37 | "\n" |
|
39 | 40 | { |
40 | 41 | "cell_type": "code", |
41 | 42 | "execution_count": null, |
| 43 | + "id": "1", |
42 | 44 | "metadata": {}, |
43 | 45 | "outputs": [], |
44 | 46 | "source": [ |
|
50 | 52 | "load_dotenv()\n", |
51 | 53 | "deployment_name = os.getenv(\"AZURE_ML_SCORE_DEPLOYMENT_NAME\") # ex., \"mistralai-mixtral-8x7b-instru-1\"\n", |
52 | 54 | "# The URL for the request\n", |
53 | | - "url = os.getenv(\"AZURE_ML_SCORE_URI\")\n", |
| 55 | + "url = os.getenv(\"AZURE_ML_MANAGED_ENDPOINT\")\n", |
54 | 56 | "\n", |
55 | 57 | "# Replace this with your API key or token\n", |
56 | | - "api_key = os.getenv(\"AZURE_ML_SCORE_API_KEY\")" |
| 58 | + "api_key = os.getenv(\"AZURE_ML_KEY\")" |
57 | 59 | ] |
58 | 60 | }, |
59 | 61 | { |
60 | 62 | "cell_type": "code", |
61 | 63 | "execution_count": null, |
| 64 | + "id": "2", |
62 | 65 | "metadata": {}, |
63 | 66 | "outputs": [], |
64 | 67 | "source": [ |
65 | 68 | "print(f\"Deployment name {deployment_name}\")\n", |
66 | 69 | "print(f\"Azure ML endpoint uri: {url}\")\n", |
67 | | - "print(f\"API key: {api_key}\")" |
| 70 | + "print(f\"API key loaded\" if api_key else \"API key not set.\")" |
68 | 71 | ] |
69 | 72 | }, |
70 | 73 | { |
71 | 74 | "cell_type": "markdown", |
| 75 | + "id": "3", |
72 | 76 | "metadata": { |
73 | 77 | "lines_to_next_cell": 0 |
74 | 78 | }, |
|
84 | 88 | { |
85 | 89 | "cell_type": "code", |
86 | 90 | "execution_count": null, |
87 | | - "metadata": { |
88 | | - "lines_to_next_cell": 2 |
89 | | - }, |
90 | | - "outputs": [], |
| 91 | + "id": "4", |
| 92 | + "metadata": {}, |
| 93 | + "outputs": [ |
| 94 | + { |
| 95 | + "name": "stdout", |
| 96 | + "output_type": "stream", |
| 97 | + "text": [ |
| 98 | + "{\"output\":\"Could you please pass me the Wi-Fi password for this network? I need it to connect my device. <|done|>\"}\n" |
| 99 | + ] |
| 100 | + } |
| 101 | + ], |
91 | 102 | "source": [ |
92 | 103 | "import json\n", |
93 | 104 | "\n", |
|
155 | 166 | { |
156 | 167 | "cell_type": "code", |
157 | 168 | "execution_count": null, |
| 169 | + "id": "5", |
158 | 170 | "metadata": {}, |
159 | 171 | "outputs": [], |
160 | 172 | "source": [] |
|
0 commit comments