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
+18-18Lines changed: 18 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,9 +13,9 @@ recommendations: false
13
13
ms.custom: devx-track-python
14
14
---
15
15
16
-
# Azure OpenAI GPT-3.5 Turbo fine-tuning tutorial
16
+
# Azure OpenAI GPT-4o-mini fine-tuning tutorial
17
17
18
-
This tutorial walks you through fine-tuning a `gpt-35-turbo-0613` model.
18
+
This tutorial walks you through fine-tuning a `gpt-4o-mini-2024-07-18` model.
19
19
20
20
In this tutorial you learn how to:
21
21
@@ -24,7 +24,7 @@ In this tutorial you learn how to:
24
24
> * Create environment variables for your resource endpoint and API key.
25
25
> * Prepare your sample training and validation datasets for fine-tuning.
26
26
> * Upload your training file and validation file for fine-tuning.
27
-
> * Create a fine-tuning job for `gpt-35-turbo-0613`.
27
+
> * Create a fine-tuning job for `gpt-4o-mini-2024-07-18`.
28
28
> * Deploy a custom fine-tuned model.
29
29
30
30
## Prerequisites
@@ -33,7 +33,7 @@ In this tutorial you learn how to:
33
33
- Python 3.8 or later version
34
34
- The following Python libraries: `json`, `requests`, `os`, `tiktoken`, `time`, `openai`, `numpy`.
35
35
-[Jupyter Notebooks](https://jupyter.org/)
36
-
- An Azure OpenAI resource in a [region where `gpt-35-turbo-0613` fine-tuning is available](../concepts/models.md). If you don't have a resource the process of creating one is documented in our resource [deployment guide](../how-to/create-resource.md).
36
+
- An Azure OpenAI resource in a [region where `gpt-4o-mini-2024-07-18` fine-tuning is available](../concepts/models.md). If you don't have a resource the process of creating one is documented in our resource [deployment guide](../how-to/create-resource.md).
- If you do not already have access to view quota, and deploy models in Azure OpenAI Studio you will require [additional permissions](../how-to/role-based-access-control.md).
39
39
@@ -106,7 +106,7 @@ source /etc/environment
106
106
107
107
### Create a sample dataset
108
108
109
-
Fine-tuning `gpt-35-turbo-0613` requires a specially formatted JSONL training file. OpenAI provides the following example in their documentation:
109
+
Fine-tuning `gpt-4o-mini-2024-07-18` requires a specially formatted JSONL training file. OpenAI provides the following example in their documentation:
110
110
111
111
```json
112
112
{"messages": [{"role": "system", "content": "Marv is a factual chatbot that is also sarcastic."}, {"role": "user", "content": "What's the capital of France?"}, {"role": "assistant", "content": "Paris, as if everyone doesn't know that already."}]}
@@ -206,7 +206,7 @@ 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-35-turbo-0613` 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. Individual examples need to remain under the `gpt-4o-mini-2024-07-18` model's input token limit of 4096 tokens.
210
210
211
211
```python
212
212
# Validate token counts
@@ -381,7 +381,7 @@ In this example we're also passing the seed parameter. The seed controls the rep
381
381
response = client.fine_tuning.jobs.create(
382
382
training_file= training_file_id,
383
383
validation_file= validation_file_id,
384
-
model="gpt-35-turbo-0613", # Enter base model name. Note that in Azure OpenAI the model name contains dashes and cannot contain dot/period characters.
384
+
model="gpt-4o-mini-2024-07-18", # Enter base model name. Note that in Azure OpenAI the model name contains dashes and cannot contain dot/period characters.
385
385
seed=105# seed parameter controls reproducibility of the fine-tuning job. If no seed is specified one will be generated automatically.
@@ -848,7 +848,7 @@ Alternatively, you can deploy your fine-tuned model using any of the other commo
848
848
| resource_group | The resource group name for your Azure OpenAI resource |
849
849
| resource_name | The Azure OpenAI resource name |
850
850
| model_deployment_name | The custom name for your new fine-tuned model deployment. This is the name that will be referenced in your code when making chat completion calls. |
851
-
| fine_tuned_model | Retrieve this value from your fine-tuning job results in the previous step. It will look like `gpt-35-turbo-0613.ft-b044a9d3cf9c4228b5d393567f693b83`. You'll need to add that value to the deploy_data json. |
851
+
| fine_tuned_model | Retrieve this value from your fine-tuning job results in the previous step. It will look like `gpt-4o-mini-2024-07-18.ft-b044a9d3cf9c4228b5d393567f693b83`. You'll need to add that value to the deploy_data json. |
"name": "<YOUR_FINE_TUNED_MODEL>", #retrieve this value from the previous call, it will look like gpt-35-turbo-0613.ft-b044a9d3cf9c4228b5d393567f693b83
875
+
"name": "<YOUR_FINE_TUNED_MODEL>", #retrieve this value from the previous call, it will look like gpt-4o-mini-2024-07-18.ft-b044a9d3cf9c4228b5d393567f693b83
876
876
"version": "1"
877
877
}
878
878
}
@@ -915,7 +915,7 @@ client = AzureOpenAI(
915
915
)
916
916
917
917
response = client.chat.completions.create(
918
-
model="gpt-35-turbo-ft", # model = "Custom deployment name you chose for your fine-tuning model"
918
+
model="gpt-4o-mini-2024-07-18-ft", # model = "Custom deployment name you chose for your fine-tuning model"
919
919
messages= [
920
920
{"role": "system", "content": "You are a helpful assistant."},
921
921
{"role": "user", "content": "Does Azure OpenAI support customer managed keys?"},
0 commit comments