Skip to content

Commit 586f15b

Browse files
Merge pull request #208398 from DenKenMSFT/UserStory1974327
Updated Python & openai-python to 3.7.1+ & 0.22.1
2 parents f27323d + 267b346 commit 586f15b

File tree

8 files changed

+21
-21
lines changed

8 files changed

+21
-21
lines changed

articles/cognitive-services/openai/concepts/models.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ The service provides access to many different models. Models describe a family o
2525

2626
## Naming convention
2727

28-
Azure OpenAI's models follow a standard naming convention: `{task}-{model name}-{version #}`. For example, our most powerful natural language model is called `text-davinci-001` and a codex series model would look like `code-cushman-001`.
28+
Azure OpenAI's models follow a standard naming convention: `{task}-{model name}-{version #}`. For example, our most powerful natural language model is called `text-davinci-001` and a Codex series model would look like `code-cushman-001`.
2929

3030
> Older versions of the GPT-3 models are available as `ada`, `babbage`, `curie`, `davinci` and do not follow these conventions. These models are primarily intended to be used for fine-tuning and search.
3131
@@ -80,7 +80,7 @@ The Codex models are descendants of our base GPT-3 models that can understand an
8080

8181
They’re most capable in Python and proficient in over a dozen languages including JavaScript, Go, Perl, PHP, Ruby, Swift, TypeScript, SQL, and even Shell.
8282

83-
Currently we only offer one codex model: `code-cushman-001`.
83+
Currently we only offer one Codex model: `code-cushman-001`.
8484

8585
## Embeddings Models
8686

articles/cognitive-services/openai/how-to/fine-tuning.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ The Azure OpenAI Service lets you tailor our models to your personal datasets us
2424

2525
- An Azure subscription - [Create one for free](https://azure.microsoft.com/free/cognitive-services)
2626
- Access granted to service in the desired Azure subscription. This service is currently invite only. You can fill out a new use case request here: <https://aka.ms/oai/access>. Please open an issue on this repo to contact us if you have an issue
27-
- The following python libraries: os, requests, json
27+
- The following Python libraries: os, requests, json
2828
- An Azure OpenAI Service resource with a model deployed. If you don't have a resource/model the process is documented in our [resource deployment guide](../how-to/create-resource.md)
2929

3030
## Fine-tuning workflow
@@ -40,7 +40,7 @@ The fine-tuning workflow requires the following steps:
4040

4141
Your training data set consists of input & output examples for how you would like the model perform.
4242

43-
The training dataset you use **must** be a JSON lines (JSONL) document where each line is a prompt-completion pair and a single example. The OpenAI python CLI provides a useful data preparation tool to easily convert your data into this file format.
43+
The training dataset you use **must** be a JSON lines (JSONL) document where each line is a prompt-completion pair and a single example. The OpenAI Python CLI provides a useful data preparation tool to easily convert your data into this file format.
4444

4545
Here's an example of the format:
4646

@@ -89,7 +89,7 @@ Once you've prepared your dataset, you can upload your files to the service. We
8989

9090
For large data files, we recommend you import from Azure Blob. Large files can become unstable when uploaded through multipart forms because the requests are atomic and can't be retried or resumed.
9191

92-
The following python code will create a sample dataset and show how to upload a file and print the returned ID. Make sure to save the IDs returned as you'll need them for the fine-tuning training job creation.
92+
The following Python code will create a sample dataset and show how to upload a file and print the returned ID. Make sure to save the IDs returned as you'll need them for the fine-tuning training job creation.
9393

9494
> [!IMPORTANT]
9595
> Remember to remove the key from your code when you're done, and never post it publicly. For production, use a secure way of storing and accessing your credentials like [Azure Key Vault](../../../key-vault/general/overview.md). See the Cognitive Services [security](../../cognitive-services-security.md) article for more information.
@@ -146,7 +146,7 @@ while train_status not in ["succeeded", "failed"] or valid_status not in ["succe
146146

147147
After you've uploaded the training and (optional) validation file, you wish to use for your training job you're ready to start the process. You can use the [Models API](../reference.md#models) to identify which models are fine-tunable.
148148

149-
Once you have the model, you want to fine-tune you need to create a job. The following python code shows an example of how to create a new job:
149+
Once you have the model, you want to fine-tune you need to create a job. The following Python code shows an example of how to create a new job:
150150

151151
```python
152152
create_args = {
@@ -220,7 +220,7 @@ az cognitiveservices account deployment create
220220

221221
## Use a fine-tuned model
222222

223-
Once your model has been deployed, you can use it like any other model. Reference the deployment name you specified in the previous step. You can use either the REST API or python SDK and can continue to use all the other Completions parameters like temperature, frequency_penalty, presence_penalty, etc., on these requests to fine-tuned models.
223+
Once your model has been deployed, you can use it like any other model. Reference the deployment name you specified in the previous step. You can use either the REST API or Python SDK and can continue to use all the other Completions parameters like temperature, frequency_penalty, presence_penalty, etc., on these requests to fine-tuned models.
224224

225225
```python
226226
print('Sending a test completion job')
@@ -316,4 +316,4 @@ That said, tweaking the hyperparameters used for fine-tuning can often lead to a
316316
## Next Steps
317317

318318
- Explore the full REST API Reference documentation to learn more about all the fine-tuning capabilities. You can find the [full REST documentation here](../reference.md).
319-
- Explore more of the [python SDK operations here](https://github.com/openai/openai-python/blob/main/examples/azure/finetuning.ipynb).
319+
- Explore more of the [Python SDK operations here](https://github.com/openai/openai-python/blob/main/examples/azure/finetuning.ipynb).

articles/cognitive-services/openai/how-to/managed-identity.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ In the following sections, you'll use the Azure CLI to assign roles, and obtain
2323
- An Azure subscription
2424
- Access granted to service in the desired Azure subscription.
2525
- Azure CLI. [Installation Guide](/cli/azure/install-azure-cli)
26-
- The following python libraries: os, requests, json
26+
- The following Python libraries: os, requests, json
2727

2828
## Sign into the Azure CLI
2929

articles/cognitive-services/openai/how-to/work-with-code.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ When you show Codex the database schema, it's able to make an informed guess abo
101101

102102
### Specify the programming language
103103

104-
Codex understands dozens of different programming languages. Many share similar conventions for comments, functions and other programming syntax. By specifying the language and what version in a comment, Codex is better able to provide a completion for what you want. That said, Codex is fairly flexible with style and syntax. Here's an example for R and python.
104+
Codex understands dozens of different programming languages. Many share similar conventions for comments, functions and other programming syntax. By specifying the language and what version in a comment, Codex is better able to provide a completion for what you want. That said, Codex is fairly flexible with style and syntax. Here's an example for R and Python.
105105

106106
```r
107107
# R language

articles/cognitive-services/openai/includes/python.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ keywords:
1717

1818
- An Azure subscription - <a href="https://azure.microsoft.com/free/cognitive-services" target="_blank">Create one for free</a>
1919
- Access granted to service in the desired Azure subscription. This service is currently invite only. You can fill out a new use case request here:<a href="https://aka.ms/oai/access" target="_blank">https://aka.ms/oai/access</a>
20-
- <a href="https://www.python.org/" target="_blank">Python 3.x</a>
21-
- The following python libraries: os, requests, json
20+
- <a href="https://www.python.org/" target="_blank">Python 3.7.1 or later version</a>
21+
- The following Python libraries: os, requests, json
2222
- An Azure OpenAI Service resource with a model deployed. If you don't have a resource/model the process is documented in our [resource deployment guide](../how-to/create-resource.md)
2323

2424
## Set up
@@ -45,7 +45,7 @@ Go to your resource in the Azure portal. The **Endpoint and Keys** can be found
4545

4646
## Create a new Python application
4747

48-
1. Create a new python file called quickstart.py. Then open it up in your preferred editor or IDE.
48+
1. Create a new Python file called quickstart.py. Then open it up in your preferred editor or IDE.
4949

5050
2. Replace the contents of quickstart.py with the following code. Modify the code to add your key, endpoint, and deployment name:
5151

articles/cognitive-services/openai/includes/rest.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ keywords:
1515

1616
- An Azure subscription - <a href="https://azure.microsoft.com/free/cognitive-services" target="_blank">Create one for free</a>
1717
- Access granted to service in the desired Azure subscription. This service is currently invite only. You can fill out a new use case request here:<a href="https://aka.ms/oai/access" target="_blank">https://aka.ms/oai/access</a>
18-
- <a href="https://www.python.org/" target="_blank">Python 3.x</a>
19-
- The following python libraries: os, requests, json
18+
- <a href="https://www.python.org/" target="_blank">Python 3.7.1 or later version</a>
19+
- The following Python libraries: os, requests, json
2020
- An Azure OpenAI Service resource with a model deployed. If you don't have a resource/model the process is documented in our [resource deployment guide](../how-to/create-resource.md)
2121

2222
## Retrieve key and endpoint
@@ -35,7 +35,7 @@ Go to your resource in the Azure portal. The **Endpoint and Keys** can be found
3535

3636
## Create a new Python application
3737

38-
Create a new python file called quickstart.py. Then open it up in your preferred editor or IDE.
38+
Create a new Python file called quickstart.py. Then open it up in your preferred editor or IDE.
3939

4040
1. Replace the contents of quickstart.py with the following code.
4141

articles/cognitive-services/openai/includes/studio.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ From here, select the **create new deployment** button in the banner at the top.
3636

3737
## Deployments
3838

39-
Before you can generate text or inference, you need to deploy a model. This is done by clicking the **create new deployment** on the deployments page. From here you can select from one of our many available models. For getting started we recommend `text-davinci-002` for users in South Central and `text-davinci-001` for users in West Europe (text-davinci-002 isn't available in this region).
39+
Before you can generate text or inference, you need to deploy a model. This is done by clicking the **create new deployment** on the deployments page. From here you can select from one of our many available models. For getting started we recommend `text-davinci-002` for users in South Central and `text-davinci-001` for users in West Europe (`text-davinci-002` isn't available in this region).
4040

4141
Once this is complete, select the 'Playground' button on the left nav to start experimenting.
4242

@@ -52,7 +52,7 @@ The best way to start exploring completions is through our Playground. It's simp
5252
- Selecting the Generate button will send the entered text to the completions API and stream the results back to the text box.
5353
- Select the 'undo' button to undo the prior generation call
5454
- Select the 'regenerate' button to do an undo & generation call together.
55-
- View the code you could use to make the same call with our python SDK, curl or other REST API client
55+
- View the code you could use to make the same call with our Python SDK, curl or other REST API client
5656
- Configure the parameters of the completions call to improve the performance of your task. You can read more about each parameter in our [REST API](../reference.md).
5757

5858
1. Now that you've familiarized yourself with the playground, get started generating text by loading the **Summarize Text** example.

articles/cognitive-services/openai/reference.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ The Azure OpenAI service provides two methods for authentication. you can use e
4040
The service APIs are versioned using the ```api-version``` query parameter. All versions follow the YYYY-MM-DD date structure, with a -preview suffix for a preview service. For example:
4141

4242
```
43-
POST https://YOUR_RESOURCE_NAME.openai.azure.com/openai/deployments/YOUR_DEPLOYMENT_NAME/completions?api-version=2021-11-01-preview
43+
POST https://YOUR_RESOURCE_NAME.openai.azure.com/openai/deployments/YOUR_DEPLOYMENT_NAME/completions?api-version=2022-06-01-preview
4444
```
4545

46-
We currently have the following versions available: ```2022-03-01-preview``` and ```2021-11-01-preview```
46+
We currently have the following versions available: ```2022-06-01-preview```
4747

4848
## Completions
4949
With the Completions operation, the model will generate one or more predicted completions based on a provided prompt. The service can also return the probabilities of alternative tokens at each position.
@@ -514,7 +514,7 @@ GET https://{your-resource-name}.openai.azure.com/openai/fine-tunes/{fine_tune_i
514514

515515
**Supported versions**
516516

517-
- `2022-03-01-preview`
517+
- `2022-06-01-preview`
518518

519519
#### Example request
520520

0 commit comments

Comments
 (0)