Skip to content

Commit 28ba2c9

Browse files
authored
Add mistral notebook (#3505)
1 parent f7dd148 commit 28ba2c9

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

sdk/python/jobs/finetuning/standalone/chat-completion/chat_completion_with_model_as_service.ipynb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
"source": [
88
"## FineTuning LLM with Model-As-Service\n",
99
"\n",
10-
"This sample shows how use create a standalone FineTuning job to fine tune a model to summarize a dialog between 2 people using samsum dataset.\n",
10+
"This sample shows how use create a standalone FineTuning job to fine tune a model using ultrachat data.\n",
1111
"\n",
1212
"#### Training data\n",
1313
"We use the [ultrachat_200k](https://huggingface.co/datasets/samsum) dataset. The dataset has four splits, suitable for:\n",
1414
"* Supervised fine-tuning (sft).\n",
1515
"* Generation ranking (gen).\n",
1616
"\n",
1717
"#### Model\n",
18-
"We will use the Phi-3-mini-4k-instruct model to show how user can finetune a model for chat-completion task. If you opened this notebook from a specific model card, remember to replace the specific model name. \n",
18+
"We will use the Ministral-3B model to show how user can finetune a model for chat-completion task. If you opened this notebook from a specific model card, remember to replace the specific model name. \n",
1919
"\n",
2020
"#### Outline\n",
2121
"1. Setup pre-requisites\n",
@@ -96,7 +96,7 @@
9696
"\n",
9797
"# the models, fine tuning pipelines and environments are available in various AzureML system registries,\n",
9898
"# Example: Phi family of models are in \"azureml\", Llama family of models are in \"azureml-meta\" registry.\n",
99-
"registry_ml_client = MLClient(credential, registry_name=\"azureml-meta\")\n",
99+
"registry_ml_client = MLClient(credential, registry_name=\"azureml-mistral\")\n",
100100
"\n",
101101
"# Get AzureML workspace object.\n",
102102
"workspace = workspace_ml_client._workspaces.get(workspace_ml_client.workspace_name)\n",
@@ -110,7 +110,7 @@
110110
"source": [
111111
"### 2. Pick a foundation model to fine tune\n",
112112
"\n",
113-
"`Phi-3-mini-4k-instruct` is a 3.8B parameters, lightweight, state-of-the-art open model built upon datasets used for Phi-2. The model belongs to the Phi-3 model family, and the Mini version comes in two variants 4K and 128K which is the context length (in tokens) it can support. You can browse these models in the Model Catalog in the Azure AI Studio, filtering by the `chat-completion` task. In this example, we use the `Phi-3-mini-4k-instruct` model. If you have opened this notebook for a different model, replace the model name and version accordingly.\n",
113+
"`Ministral-3B` is a 3B parameters, lightweight, state-of-the-art open model. The model belongs to the mistral model family. You can browse these models in the Model Catalog in the Azure AI Studio, filtering by the `chat-completion` task. In this example, we use the `Ministral-3B` model. If you have opened this notebook for a different model, replace the model name and version accordingly.\n",
114114
"\n",
115115
"Note the model id property of the model. This will be passed as input to the fine tuning job. This is also available as the `Asset ID` field in model details page in Azure AI Studio Model Catalog."
116116
]
@@ -121,7 +121,7 @@
121121
"metadata": {},
122122
"outputs": [],
123123
"source": [
124-
"model_name = \"Phi-3-mini-4k-instruct\" # \"Meta-Llama-3.1-8B-Instruct\"\n",
124+
"model_name = \"Ministral-3B\"\n",
125125
"foundation_model = registry_ml_client.models.get(model_name, label=\"latest\")\n",
126126
"print(\n",
127127
" \"\\n\\nUsing model name: {0}, version: {1}, id: {2} for fine tuning\".format(\n",
@@ -139,7 +139,7 @@
139139
"from azure.ai.ml.constants._common import AssetTypes\n",
140140
"from azure.ai.ml.entities._inputs_outputs import Input\n",
141141
"\n",
142-
"model_to_finetune = Input(type=AssetTypes.MLFLOW_MODEL, path=foundation_model.id)"
142+
"model_to_finetune = Input(type=AssetTypes.CUSTOM_MODEL, path=foundation_model.id)"
143143
]
144144
},
145145
{
@@ -401,7 +401,7 @@
401401
" validation_data=validation_data,\n",
402402
" hyperparameters={\n",
403403
" \"per_device_train_batch_size\": \"1\",\n",
404-
" \"learning_rate\": \"0.00002\",\n",
404+
" \"learning_rate\": \"0.0001\",\n",
405405
" \"num_train_epochs\": \"1\",\n",
406406
" },\n",
407407
" model=model_to_finetune,\n",

0 commit comments

Comments
 (0)