Skip to content

Commit 11a15d9

Browse files
Merge pull request #261110 from mrbullwinkle/mrb_12_13_2023_api_ft
[Azure OpenAI] API version update
2 parents 067bcb4 + 32e46bb commit 11a15d9

File tree

6 files changed

+15
-15
lines changed

6 files changed

+15
-15
lines changed

articles/ai-services/openai/how-to/migration.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ from openai import AzureOpenAI
147147

148148
client = AzureOpenAI(
149149
api_key=os.getenv("AZURE_OPENAI_KEY"),
150-
api_version="2023-10-01-preview",
150+
api_version="2023-12-01-preview",
151151
azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT")
152152
)
153153

@@ -218,7 +218,7 @@ from openai import AsyncAzureOpenAI
218218
async def main():
219219
client = AsyncAzureOpenAI(
220220
api_key = os.getenv("AZURE_OPENAI_KEY"),
221-
api_version = "2023-10-01-preview",
221+
api_version = "2023-12-01-preview",
222222
azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT")
223223
)
224224
response = await client.chat.completions.create(model="gpt-35-turbo", messages=[{"role": "user", "content": "Hello world"}])
@@ -236,7 +236,7 @@ from openai import AzureOpenAI
236236

237237
token_provider = get_bearer_token_provider(DefaultAzureCredential(), "https://cognitiveservices.azure.com/.default")
238238

239-
api_version = "2023-10-01-preview"
239+
api_version = "2023-12-01-preview"
240240
endpoint = "https://my-resource.openai.azure.com"
241241

242242
client = AzureOpenAI(

articles/ai-services/openai/how-to/switching-endpoints.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ from openai import AzureOpenAI
5050

5151
client = AzureOpenAI(
5252
api_key=os.getenv("AZURE_OPENAI_KEY"),
53-
api_version="2023-10-01-preview",
53+
api_version="2023-12-01-preview",
5454
azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT")
5555
)
5656
```

articles/ai-services/openai/includes/fine-tuning-python.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ import os
151151
openai.api_key = os.getenv("AZURE_OPENAI_API_KEY")
152152
openai.api_base = os.getenv("AZURE_OPENAI_ENDPOINT")
153153
openai.api_type = 'azure'
154-
openai.api_version = '2023-10-01-preview' # This API version or later is required to access fine-tuning for turbo/babbage-002/davinci-002
154+
openai.api_version = '2023-12-01-preview' # This API version or later is required to access fine-tuning for turbo/babbage-002/davinci-002
155155

156156
training_file_name = 'training_set.jsonl'
157157
validation_file_name = 'validation_set.jsonl'
@@ -183,7 +183,7 @@ from openai import AzureOpenAI
183183
client = AzureOpenAI(
184184
azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT"),
185185
api_key=os.getenv("AZURE_OPENAI_KEY"),
186-
api_version="2023-10-01-preview" # This API version or later is required to access fine-tuning for turbo/babbage-002/davinci-002
186+
api_version="2023-12-01-preview" # This API version or later is required to access fine-tuning for turbo/babbage-002/davinci-002
187187
)
188188

189189
training_file_name = 'training_set.jsonl'

articles/ai-services/openai/includes/fine-tuning-rest.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ For large data files, we recommend that you import from an Azure Blob store. Lar
150150
### Upload training data
151151

152152
```bash
153-
curl -X POST $AZURE_OPENAI_ENDPOINT/openai/files?api-version=2023-10-01-preview \
153+
curl -X POST $AZURE_OPENAI_ENDPOINT/openai/files?api-version=2023-12-01-preview \
154154
-H "Content-Type: multipart/form-data" \
155155
-H "api-key: $AZURE_OPENAI_KEY" \
156156
-F "purpose=fine-tune" \
@@ -160,7 +160,7 @@ curl -X POST $AZURE_OPENAI_ENDPOINT/openai/files?api-version=2023-10-01-preview
160160
### Upload validation data
161161

162162
```bash
163-
curl -X POST $AZURE_OPENAI_ENDPOINT/openai/files?api-version=2023-10-01-preview \
163+
curl -X POST $AZURE_OPENAI_ENDPOINT/openai/files?api-version=2023-12-01-preview \
164164
-H "Content-Type: multipart/form-data" \
165165
-H "api-key: $AZURE_OPENAI_KEY" \
166166
-F "purpose=fine-tune" \
@@ -172,7 +172,7 @@ curl -X POST $AZURE_OPENAI_ENDPOINT/openai/files?api-version=2023-10-01-preview
172172
After you uploaded your training and validation files, you're ready to start the fine-tuning job. The following code shows an example of how to create a new fine-tuning job with the REST API:
173173

174174
```bash
175-
curl -X POST $AZURE_OPENAI_ENDPOINT/openai/fine_tuning/jobs?api-version=2023-10-01-preview \
175+
curl -X POST $AZURE_OPENAI_ENDPOINT/openai/fine_tuning/jobs?api-version=2023-12-01-preview \
176176
-H "Content-Type: application/json" \
177177
-H "api-key: $AZURE_OPENAI_KEY" \
178178
-d '{
@@ -187,7 +187,7 @@ curl -X POST $AZURE_OPENAI_ENDPOINT/openai/fine_tuning/jobs?api-version=2023-10-
187187
After you start a fine-tune job, it can take some time to complete. Your job might be queued behind other jobs in the system. Training your model can take minutes or hours depending on the model and dataset size. The following example uses the REST API to check the status of your fine-tuning job. The example retrieves information about your job by using the job ID returned from the previous example:
188188
189189
```bash
190-
curl -X GET $AZURE_OPENAI_ENDPOINT/openai/fine_tuning/jobs/<YOUR-JOB-ID>?api-version=2023-10-01-preview \
190+
curl -X GET $AZURE_OPENAI_ENDPOINT/openai/fine_tuning/jobs/<YOUR-JOB-ID>?api-version=2023-12-01-preview \
191191
-H "api-key: $AZURE_OPENAI_KEY"
192192
```
193193
@@ -266,12 +266,12 @@ Azure OpenAI attaches a result file named _results.csv_ to each fine-tune job af
266266
The following Python example uses the REST API to retrieve the file ID of the first result file attached to the fine-tune job for your customized model, and then downloads the file to your working directory for analysis.
267267
268268
```bash
269-
curl -X GET "$AZURE_OPENAI_ENDPOINT/openai/fine_tuning/jobs/<JOB_ID>?api-version=2023-10-01-preview" \
269+
curl -X GET "$AZURE_OPENAI_ENDPOINT/openai/fine_tuning/jobs/<JOB_ID>?api-version=2023-12-01-preview" \
270270
-H "api-key: $AZURE_OPENAI_KEY")
271271
```
272272
273273
```bash
274-
curl -X GET "$AZURE_OPENAI_ENDPOINT/openai/files/<RESULT_FILE_ID>/content?api-version=2023-10-01-preview" \
274+
curl -X GET "$AZURE_OPENAI_ENDPOINT/openai/files/<RESULT_FILE_ID>/content?api-version=2023-12-01-preview" \
275275
-H "api-key: $AZURE_OPENAI_KEY" > <RESULT_FILENAME>
276276
```
277277

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ from openai import AzureOpenAI
103103

104104
client = AzureOpenAI(
105105
api_key=os.getenv("AZURE_OPENAI_KEY"),
106-
api_version="2023-10-01-preview",
106+
api_version="2023-12-01-preview",
107107
azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT")
108108
)
109109

articles/ai-services/openai/tutorials/fine-tune.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ import os
293293
openai.api_key = os.getenv("AZURE_OPENAI_API_KEY")
294294
openai.api_base = os.getenv("AZURE_OPENAI_ENDPOINT")
295295
openai.api_type = 'azure'
296-
openai.api_version = '2023-10-01-preview' # This API version or later is required to access fine-tuning for turbo/babbage-002/davinci-002
296+
openai.api_version = '2023-12-01-preview' # This API version or later is required to access fine-tuning for turbo/babbage-002/davinci-002
297297

298298
training_file_name = 'training_set.jsonl'
299299
validation_file_name = 'validation_set.jsonl'
@@ -325,7 +325,7 @@ from openai import AzureOpenAI
325325
client = AzureOpenAI(
326326
azure_endpoint = os.getenv("AZURE_OPENAI_ENDPOINT"),
327327
api_key=os.getenv("AZURE_OPENAI_KEY"),
328-
api_version="2023-10-01-preview" # This API version or later is required to access fine-tuning for turbo/babbage-002/davinci-002
328+
api_version="2023-12-01-preview" # This API version or later is required to access fine-tuning for turbo/babbage-002/davinci-002
329329
)
330330

331331
training_file_name = 'training_set.jsonl'

0 commit comments

Comments
 (0)