"In this example we'll try to go over all operations for embeddings that can be done using the Azure endpoints. \\\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 tutorial."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import openai\n",
"from openai import cli"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Setup\n",
"In the following section the endpoint and key need to be set up of the next sections to work. \\\n",
"Please go to https://portal.azure.com, find your resource and then under \"Resource Management\" -> \"Keys and Endpoints\" look for the \"Endpoint\" value and one of the Keys. They will act as api_base and api_key in the code below."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"openai.api_key = '' # Please add your api key here\n",
"openai.api_base = '' # Please add your endpoint here\n",
"\n",
"openai.api_type = 'azure'\n",
"openai.api_version = '2022-03-01-preview' # this may change in the future"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Deployments\n",
"In this section we are going to create a deployment using the finetune model that we just adapted and then used the deployment to create a simple completion operation."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Deployments: Create Manually\n",
"Let's create a deployment using the text-similarity-curie-001 engine. You can create a new deployment by going to your Resource in your portal under \"Resource Management\" -> \"Deployments\"."