|
108 | 108 | "\n",
|
109 | 109 | "---\n",
|
110 | 110 | "\n",
|
111 |
| - "First we will deploy the Llama-2 model as a SageMaker endpoint. To train/deploy 8B and 70B models, please change model_id to \"meta-textgeneration-llama-3-8b\" and \"meta-textgeneration-llama-3-70b\" respectively.\n", |
| 111 | + "First we will deploy the Llama-3 model as a SageMaker endpoint. To train/deploy 8B and 70B models, please change model_id to \"meta-textgeneration-llama-3-8b\" and \"meta-textgeneration-llama-3-70b\" respectively.\n", |
112 | 112 | "\n",
|
113 | 113 | "---"
|
114 | 114 | ]
|
|
193 | 193 | " },\n",
|
194 | 194 | "}\n",
|
195 | 195 | "try:\n",
|
196 |
| - " response = pretrained_predictor.predict(\n", |
197 |
| - " payload, custom_attributes=\"accept_eula=false\"\n", |
198 |
| - " )\n", |
| 196 | + " response = pretrained_predictor.predict(payload, custom_attributes=\"accept_eula=false\")\n", |
199 | 197 | " print_response(payload, response)\n",
|
200 | 198 | "except Exception as e:\n",
|
201 | 199 | " print(e)"
|
|
249 | 247 | "dolly_dataset = load_dataset(\"databricks/databricks-dolly-15k\", split=\"train\")\n",
|
250 | 248 | "\n",
|
251 | 249 | "# To train for question answering/information extraction, you can replace the assertion in next line to example[\"category\"] == \"closed_qa\"/\"information_extraction\".\n",
|
252 |
| - "summarization_dataset = dolly_dataset.filter(\n", |
253 |
| - " lambda example: example[\"category\"] == \"summarization\"\n", |
254 |
| - ")\n", |
| 250 | + "summarization_dataset = dolly_dataset.filter(lambda example: example[\"category\"] == \"summarization\")\n", |
255 | 251 | "summarization_dataset = summarization_dataset.remove_columns(\"category\")\n",
|
256 | 252 | "\n",
|
257 | 253 | "# We split the dataset into two where test data is used to evaluate at the end.\n",
|
|
376 | 372 | " instance_type=\"ml.g5.12xlarge\", # For Llama-3-70b, add instance_type = \"ml.g5.48xlarge\"\n",
|
377 | 373 | ")\n",
|
378 | 374 | "# By default, instruction tuning is set to false. Thus, to use instruction tuning dataset you use\n",
|
379 |
| - "estimator.set_hyperparameters(\n", |
380 |
| - " instruction_tuned=\"True\", epoch=\"5\", max_input_length=\"1024\"\n", |
381 |
| - ")\n", |
| 375 | + "estimator.set_hyperparameters(instruction_tuned=\"True\", epoch=\"5\", max_input_length=\"1024\")\n", |
382 | 376 | "estimator.fit({\"training\": train_data_location})"
|
383 | 377 | ]
|
384 | 378 | },
|
|
0 commit comments