mirror of
https://github.com/james-m-jordan/openai-cookbook.git
synced 2025-05-09 19:32:38 +00:00
Fix setup sections
This commit is contained in:
parent
9b3fd89a26
commit
0bd2dcfa5c
@ -24,7 +24,7 @@
|
|||||||
"metadata": {},
|
"metadata": {},
|
||||||
"source": [
|
"source": [
|
||||||
"## Setup\n",
|
"## Setup\n",
|
||||||
"For the following sections to work properly we first have to setup some things. Let's start with the `api_type`, `api_base` and `api_version`. To find your `api_base` go to https://portal.azure.com, find your resource and then under \"Resource Management\" -> \"Keys and Endpoints\" look for the \"Endpoint\" value."
|
"For the following sections to work properly we first have to setup some things. Let's start with the `api_base` and `api_version`. To find your `api_base` go to https://portal.azure.com, find your resource and then under \"Resource Management\" -> \"Keys and Endpoints\" look for the \"Endpoint\" value."
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -33,9 +33,7 @@
|
|||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"openai.api_type = 'azure'\n",
|
|
||||||
"openai.api_version = '2022-12-01'\n",
|
"openai.api_version = '2022-12-01'\n",
|
||||||
"\n",
|
|
||||||
"openai.api_base = '' # Please add your endpoint here"
|
"openai.api_base = '' # Please add your endpoint here"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -43,7 +41,7 @@
|
|||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"source": [
|
"source": [
|
||||||
"We next have to setup the `api_key`. We can either get the key from the portal or we can get it through Microsoft Active Directory Authentication."
|
"We next have to setup the `api_type` and `api_key`. We can either get the key from the portal or we can get it through Microsoft Active Directory Authentication. Depending on this the `api_type` is either `azure` or `azure_ad`."
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -60,6 +58,7 @@
|
|||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
|
"openai.api_type = 'azure'\n",
|
||||||
"openai.api_key = '' # Please add your api key here"
|
"openai.api_key = '' # Please add your api key here"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -83,6 +82,7 @@
|
|||||||
"default_credential = DefaultAzureCredential()\n",
|
"default_credential = DefaultAzureCredential()\n",
|
||||||
"token = default_credential.get_token(\"https://cognitiveservices.azure.com/.default\")\n",
|
"token = default_credential.get_token(\"https://cognitiveservices.azure.com/.default\")\n",
|
||||||
"\n",
|
"\n",
|
||||||
|
"openai.api_type = 'azure_ad'\n",
|
||||||
"openai.api_key = token.token\n",
|
"openai.api_key = token.token\n",
|
||||||
"\"\"\""
|
"\"\"\""
|
||||||
]
|
]
|
||||||
|
@ -21,11 +21,12 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"attachments": {},
|
||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"source": [
|
"source": [
|
||||||
"## Setup\n",
|
"## Setup\n",
|
||||||
"For the following sections to work properly we first have to setup some things. Let's start with the `api_type`, `api_base` and `api_version`. To find your `api_base` go to https://portal.azure.com, find your resource and then under \"Resource Management\" -> \"Keys and Endpoints\" look for the \"Endpoint\" value."
|
"For the following sections to work properly we first have to setup some things. Let's start with the `api_base` and `api_version`. To find your `api_base` go to https://portal.azure.com, find your resource and then under \"Resource Management\" -> \"Keys and Endpoints\" look for the \"Endpoint\" value."
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -34,9 +35,7 @@
|
|||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"openai.api_type = 'azure'\n",
|
|
||||||
"openai.api_version = '2022-12-01'\n",
|
"openai.api_version = '2022-12-01'\n",
|
||||||
"\n",
|
|
||||||
"openai.api_base = '' # Please add your endpoint here"
|
"openai.api_base = '' # Please add your endpoint here"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -45,7 +44,7 @@
|
|||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"source": [
|
"source": [
|
||||||
"We next have to setup the `api_key`. We can either get the key from the portal or we can get it through Microsoft Active Directory Authentication."
|
"We next have to setup the `api_type` and `api_key`. We can either get the key from the portal or we can get it through Microsoft Active Directory Authentication. Depending on this the `api_type` is either `azure` or `azure_ad`."
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -63,6 +62,7 @@
|
|||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
|
"openai.api_type = 'azure'\n",
|
||||||
"openai.api_key = '' # Please add your api key here"
|
"openai.api_key = '' # Please add your api key here"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -87,6 +87,7 @@
|
|||||||
"default_credential = DefaultAzureCredential()\n",
|
"default_credential = DefaultAzureCredential()\n",
|
||||||
"token = default_credential.get_token(\"https://cognitiveservices.azure.com/.default\")\n",
|
"token = default_credential.get_token(\"https://cognitiveservices.azure.com/.default\")\n",
|
||||||
"\n",
|
"\n",
|
||||||
|
"openai.api_type = 'azure_ad'\n",
|
||||||
"openai.api_key = token.token\n",
|
"openai.api_key = token.token\n",
|
||||||
"\"\"\""
|
"\"\"\""
|
||||||
]
|
]
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
"source": [
|
"source": [
|
||||||
"# Azure Fine tuning example\n",
|
"# Azure Fine tuning example\n",
|
||||||
"In this example we'll try to go over all operations that can be done using the Azure endpoints and their differences with the openAi endpoints (if any).<br>\n",
|
"In this example we'll try to go over all operations that can be done using the Azure endpoints and their differences with the openAi endpoints (if any).<br>\n",
|
||||||
"This example focuses on finetuning but touches on the majority of operations that are also available using the API. This example is meant to be a quick way of showing simple operations and is not meant as a finetune model adaptation tutorial.\n"
|
"This example focuses on finetuning but also touches on the majority of operations that are available using the API. This example is meant to be a quick way of showing simple operations and is not meant as a finetune model adaptation tutorial.\n"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -24,7 +24,7 @@
|
|||||||
"metadata": {},
|
"metadata": {},
|
||||||
"source": [
|
"source": [
|
||||||
"## Setup\n",
|
"## Setup\n",
|
||||||
"For the following sections to work properly we first have to setup some things. Let's start with the `api_type`, `api_base` and `api_version`. To find your `api_base` go to https://portal.azure.com, find your resource and then under \"Resource Management\" -> \"Keys and Endpoints\" look for the \"Endpoint\" value."
|
"For the following sections to work properly we first have to setup some things. Let's start with the `api_base` and `api_version`. To find your `api_base` go to https://portal.azure.com, find your resource and then under \"Resource Management\" -> \"Keys and Endpoints\" look for the \"Endpoint\" value."
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -33,9 +33,7 @@
|
|||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"openai.api_type = 'azure'\n",
|
|
||||||
"openai.api_version = '2022-12-01'\n",
|
"openai.api_version = '2022-12-01'\n",
|
||||||
"\n",
|
|
||||||
"openai.api_base = '' # Please add your endpoint here"
|
"openai.api_base = '' # Please add your endpoint here"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -43,7 +41,7 @@
|
|||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"source": [
|
"source": [
|
||||||
"We next have to setup the `api_key`. We can either get the key from the portal or we can get it through Microsoft Active Directory Authentication."
|
"We next have to setup the `api_type` and `api_key`. We can either get the key from the portal or we can get it through Microsoft Active Directory Authentication. Depending on this the `api_type` is either `azure` or `azure_ad`."
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -60,6 +58,7 @@
|
|||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
|
"openai.api_type = 'azure'\n",
|
||||||
"openai.api_key = '' # Please add your api key here"
|
"openai.api_key = '' # Please add your api key here"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -84,6 +83,7 @@
|
|||||||
"default_credential = DefaultAzureCredential()\n",
|
"default_credential = DefaultAzureCredential()\n",
|
||||||
"token = default_credential.get_token(\"https://cognitiveservices.azure.com/.default\")\n",
|
"token = default_credential.get_token(\"https://cognitiveservices.azure.com/.default\")\n",
|
||||||
"\n",
|
"\n",
|
||||||
|
"openai.api_type = 'azure_ad'\n",
|
||||||
"openai.api_key = token.token\n",
|
"openai.api_key = token.token\n",
|
||||||
"\"\"\""
|
"\"\"\""
|
||||||
]
|
]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user