You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/ai-services/openai/tutorials/fine-tune.md
+25-22Lines changed: 25 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,12 @@
1
1
---
2
-
title: Azure OpenAI Service fine-tuning gpt-3.5-turbo
2
+
title: Azure OpenAI Service fine-tuning gpt-4o-mini
3
3
titleSuffix: Azure OpenAI
4
-
description: Learn how to use Azure OpenAI's latest fine-tuning capabilities with gpt-3.5-turbo.
4
+
description: Learn how to use Azure OpenAI's latest fine-tuning capabilities with gpt-4o-mini-2024-07-18
5
5
#services: cognitive-services
6
6
manager: nitinme
7
7
ms.service: azure-ai-openai
8
8
ms.topic: tutorial
9
-
ms.date: 05/15/2024
9
+
ms.date: 09/09/2024
10
10
author: mrbullwinkle
11
11
ms.author: mbullwin
12
12
recommendations: false
@@ -206,7 +206,10 @@ First example in validation set:
206
206
207
207
In this case we only have 10 training and 10 validation examples so while this will demonstrate the basic mechanics of fine-tuning a model this in unlikely to be a large enough number of examples to produce a consistently noticeable impact.
208
208
209
-
Now you can then run some additional code from OpenAI using the tiktoken library to validate the token counts. Individual examples need to remain under the `gpt-4o-mini-2024-07-18` model's input token limit of 4096 tokens.
209
+
Now you can then run some additional code from OpenAI using the tiktoken library to validate the token counts. Token counting using this method is not going to give you the exact token counts that will be used for fine-tuning, but should provide a good estimate.
210
+
211
+
> [!NOTE]
212
+
> Individual examples need to remain under the `gpt-4o-mini-2024-07-18` model's current training example context legnth of: 64,536 tokens. The model's input token limit remains 128,000 tokens.
210
213
211
214
```python
212
215
# Validate token counts
@@ -216,7 +219,7 @@ import tiktoken
216
219
import numpy as np
217
220
from collections import defaultdict
218
221
219
-
encoding = tiktoken.get_encoding("cl100k_base") # default encoding used by gpt-4, turbo, and text-embedding-ada-002 models
222
+
encoding = tiktoken.get_encoding("o200k_base") # default encoding for gpt-4o models. This requires the latest version of tiktoken to be installed.
api_version="2024-05-01-preview"# This API version or later is required to access seed/events/checkpoint features
310
+
api_version="2024-08-01-preview"# This API version or later is required to access seed/events/checkpoint features
308
311
)
309
312
310
313
training_file_name ='training_set.jsonl'
@@ -564,7 +567,7 @@ Found 4 fine-tune jobs.
564
567
565
568
## List fine-tuning events
566
569
567
-
API version: `2024-05-01-preview` or later is required for this command.
570
+
API version: `2024-08-01-preview` or later is required for this command.
568
571
569
572
While not necessary to complete fine-tuning it can be helpful to examine the individual fine-tuning events that were generated during training. The full training results can also be examined after training is complete in the [training results file](../how-to/fine-tuning.md#analyze-your-customized-model).
570
573
@@ -728,7 +731,7 @@ This command isn't available in the 0.28.1 OpenAI Python library. Upgrade to the
728
731
729
732
## List checkpoints
730
733
731
-
API version: `2024-05-01-preview` or later is required for this command.
734
+
API version: `2024-08-01-preview` or later is required for this command.
732
735
733
736
When each training epoch completes a checkpoint is generated. A checkpoint is a fully functional version of a model which can both be deployed and used as the target model for subsequent fine-tuning jobs. Checkpoints can be particularly useful, as they can provide a snapshot of your model prior to overfitting having occurred. When a fine-tuning job completes you will have the three most recent versions of the model available to deploy. The final epoch will be represented by your fine-tuned model, the previous two epochs will be available as checkpoints.
734
737
@@ -911,7 +914,7 @@ from openai import AzureOpenAI
0 commit comments