Skip to content

Commit fccaf6b

Browse files
authored
Merge branch 'GoogleCloudPlatform:main' into main
2 parents 2eeadf6 + 751b8e7 commit fccaf6b

File tree

33 files changed

+1285
-398
lines changed

33 files changed

+1285
-398
lines changed

notebooks/community/migration/UJ7 AutoML for natural language with Vertex AI Text Entity Extraction.ipynb

Lines changed: 33 additions & 171 deletions
Original file line numberDiff line numberDiff line change
@@ -109,27 +109,27 @@
109109
"id": "3Sq3sGfdt89E"
110110
},
111111
"source": [
112-
"## Before you begin\r\n",
113-
"\r\n",
114-
"### GPU run-time\r\n",
115-
"\r\n",
116-
"*Make sure you're running this notebook in a GPU runtime if you have that option. In Colab, select* **Runtime > Change Runtime Type > GPU**\r\n",
117-
"\r\n",
118-
"### Set up your GCP project\r\n",
119-
"\r\n",
120-
"**The following steps are required, regardless of your notebook environment.**\r\n",
121-
"\r\n",
122-
"1. [Select or create a GCP project](https://console.cloud.google.com/cloud-resource-manager). When you first create an account, you get a $300 free credit towards your compute/storage costs.\r\n",
123-
"\r\n",
124-
"2. [Make sure that billing is enabled for your project.](https://cloud.google.com/billing/docs/how-to/modify-project)\r\n",
125-
"\r\n",
126-
"3. [Enable the Vertex APIs and Compute Engine APIs.](https://console.cloud.google.com/flows/enableapi?apiid=ml.googleapis.com,compute_component)\r\n",
127-
"\r\n",
128-
"4. [Google Cloud SDK](https://cloud.google.com/sdk) is already installed in Google Cloud Notebooks.\r\n",
129-
"\r\n",
130-
"5. Enter your project ID in the cell below. Then run the cell to make sure the\r\n",
131-
"Cloud SDK uses the right project for all the commands in this notebook.\r\n",
132-
"\r\n",
112+
"## Before you begin\n",
113+
"\n",
114+
"### GPU run-time\n",
115+
"\n",
116+
"*Make sure you're running this notebook in a GPU runtime if you have that option. In Colab, select* **Runtime > Change Runtime Type > GPU**\n",
117+
"\n",
118+
"### Set up your GCP project\n",
119+
"\n",
120+
"**The following steps are required, regardless of your notebook environment.**\n",
121+
"\n",
122+
"1. [Select or create a GCP project](https://console.cloud.google.com/cloud-resource-manager). When you first create an account, you get a $300 free credit towards your compute/storage costs.\n",
123+
"\n",
124+
"2. [Make sure that billing is enabled for your project.](https://cloud.google.com/billing/docs/how-to/modify-project)\n",
125+
"\n",
126+
"3. [Enable the Vertex APIs and Compute Engine APIs.](https://console.cloud.google.com/flows/enableapi?apiid=ml.googleapis.com,compute_component)\n",
127+
"\n",
128+
"4. [Google Cloud SDK](https://cloud.google.com/sdk) is already installed in Google Cloud Notebooks.\n",
129+
"\n",
130+
"5. Enter your project ID in the cell below. Then run the cell to make sure the\n",
131+
"Cloud SDK uses the right project for all the commands in this notebook.\n",
132+
"\n",
133133
"**Note**: Jupyter runs lines prefixed with `!` as shell commands, and it interpolates Python variables prefixed with `$` into these commands."
134134
]
135135
},
@@ -240,11 +240,11 @@
240240
"id": "9zpjPUOhvRQz"
241241
},
242242
"source": [
243-
"### Authenticate your GCP account\r\n",
244-
"\r\n",
245-
"**If you are using Google Cloud Notebooks**, your environment is already\r\n",
246-
"authenticated. Skip this step.\r\n",
247-
"\r\n",
243+
"### Authenticate your GCP account\n",
244+
"\n",
245+
"**If you are using Google Cloud Notebooks**, your environment is already\n",
246+
"authenticated. Skip this step.\n",
247+
"\n",
248248
"*Note: If you are on an Vertex notebook and run the cell, the cell knows to skip executing the authentication steps.*"
249249
]
250250
},
@@ -1459,8 +1459,7 @@
14591459
"id": "gM-YixlLmDy9"
14601460
},
14611461
"source": [
1462-
"### Make a batch prediction file\r\n",
1463-
"\r\n"
1462+
"### Make a batch prediction file\n"
14641463
]
14651464
},
14661465
{
@@ -1489,19 +1488,6 @@
14891488
"! gsutil cat $gcs_test_item"
14901489
]
14911490
},
1492-
{
1493-
"cell_type": "markdown",
1494-
"metadata": {
1495-
"id": "sPupiwqN_jAB"
1496-
},
1497-
"source": [
1498-
"*Example output*:\n",
1499-
"```\n",
1500-
"{\"content\": \"gs://migration-ucaip-trainingaip-20210301154552/test.txt\", \"mime_type\": \"text/plain\"}\n",
1501-
"Molecular basis of hexosaminidase A deficiency and pseudodeficiency in the Berks County Pennsylvania Dutch.\\tFollowing the birth of two infants with Tay-Sachs disease ( TSD ) , a non-Jewish , Pennsylvania Dutch kindred was screened for TSD carriers using the biochemical assay . A high frequency of individuals who appeared to be TSD heterozygotes was detected ( Kelly et al . , 1975 ) . Clinical and biochemical evidence suggested that the increased carrier frequency was due to at least two altered alleles for the hexosaminidase A alpha-subunit . We now report two mutant alleles in this Pennsylvania Dutch kindred , and one polymorphism . One allele , reported originally in a French TSD patient ( Akli et al . , 1991 ) , is a GT-- > AT transition at the donor splice-site of intron 9 . The second , a C-- > T transition at nucleotide 739 ( Arg247Trp ) , has been shown by Triggs-Raine et al . ( 1992 ) to be a clinically benign \" pseudodeficient \" allele associated with reduced enzyme activity against artificial substrate . Finally , a polymorphism [ G-- > A ( 759 ) ] , which leaves valine at codon 253 unchanged , is described\n",
1502-
"```\n"
1503-
]
1504-
},
15051491
{
15061492
"cell_type": "markdown",
15071493
"metadata": {
@@ -1557,45 +1543,6 @@
15571543
")"
15581544
]
15591545
},
1560-
{
1561-
"cell_type": "markdown",
1562-
"metadata": {
1563-
"id": "sPupiwqN_jAB"
1564-
},
1565-
"source": [
1566-
"*Example output*:\n",
1567-
"```\n",
1568-
"{\n",
1569-
" \"parent\": \"projects/migration-ucaip-training/locations/us-central1\",\n",
1570-
" \"batchPredictionJob\": {\n",
1571-
" \"displayName\": \"ten_20210301154552\",\n",
1572-
" \"model\": \"projects/116273516712/locations/us-central1/models/4400738115568795648\",\n",
1573-
" \"inputConfig\": {\n",
1574-
" \"instancesFormat\": \"jsonl\",\n",
1575-
" \"gcsSource\": {\n",
1576-
" \"uris\": [\n",
1577-
" \"gs://migration-ucaip-trainingaip-20210301154552/test.jsonl\"\n",
1578-
" ]\n",
1579-
" }\n",
1580-
" },\n",
1581-
" \"outputConfig\": {\n",
1582-
" \"predictionsFormat\": \"jsonl\",\n",
1583-
" \"gcsDestination\": {\n",
1584-
" \"outputUriPrefix\": \"gs://migration-ucaip-trainingaip-20210301154552/batch_output/\"\n",
1585-
" }\n",
1586-
" },\n",
1587-
" \"dedicatedResources\": {\n",
1588-
" \"machineSpec\": {\n",
1589-
" \"machineType\": \"n1-standard-2\"\n",
1590-
" },\n",
1591-
" \"startingReplicaCount\": 1,\n",
1592-
" \"maxReplicaCount\": 1\n",
1593-
" }\n",
1594-
" }\n",
1595-
"}\n",
1596-
"```\n"
1597-
]
1598-
},
15991546
{
16001547
"cell_type": "markdown",
16011548
"metadata": {
@@ -1638,42 +1585,6 @@
16381585
"print(MessageToJson(request.__dict__[\"_pb\"]))"
16391586
]
16401587
},
1641-
{
1642-
"cell_type": "markdown",
1643-
"metadata": {
1644-
"id": "sPupiwqN_jAB"
1645-
},
1646-
"source": [
1647-
"*Example output*:\n",
1648-
"```\n",
1649-
"{\n",
1650-
" \"name\": \"projects/116273516712/locations/us-central1/batchPredictionJobs/3588251799200464896\",\n",
1651-
" \"displayName\": \"ten_20210301154552\",\n",
1652-
" \"model\": \"projects/116273516712/locations/us-central1/models/4400738115568795648\",\n",
1653-
" \"inputConfig\": {\n",
1654-
" \"instancesFormat\": \"jsonl\",\n",
1655-
" \"gcsSource\": {\n",
1656-
" \"uris\": [\n",
1657-
" \"gs://migration-ucaip-trainingaip-20210301154552/test.jsonl\"\n",
1658-
" ]\n",
1659-
" }\n",
1660-
" },\n",
1661-
" \"outputConfig\": {\n",
1662-
" \"predictionsFormat\": \"jsonl\",\n",
1663-
" \"gcsDestination\": {\n",
1664-
" \"outputUriPrefix\": \"gs://migration-ucaip-trainingaip-20210301154552/batch_output/\"\n",
1665-
" }\n",
1666-
" },\n",
1667-
" \"state\": \"JOB_STATE_PENDING\",\n",
1668-
" \"completionStats\": {\n",
1669-
" \"incompleteCount\": \"-1\"\n",
1670-
" },\n",
1671-
" \"createTime\": \"2021-03-01T17:59:42.777083Z\",\n",
1672-
" \"updateTime\": \"2021-03-01T17:59:42.777083Z\"\n",
1673-
"}\n",
1674-
"```\n"
1675-
]
1676-
},
16771588
{
16781589
"cell_type": "code",
16791590
"execution_count": null,
@@ -1739,42 +1650,6 @@
17391650
"print(MessageToJson(request.__dict__[\"_pb\"]))"
17401651
]
17411652
},
1742-
{
1743-
"cell_type": "markdown",
1744-
"metadata": {
1745-
"id": "sPupiwqN_jAB"
1746-
},
1747-
"source": [
1748-
"*Example output*:\n",
1749-
"```\n",
1750-
"{\n",
1751-
" \"name\": \"projects/116273516712/locations/us-central1/batchPredictionJobs/3588251799200464896\",\n",
1752-
" \"displayName\": \"ten_20210301154552\",\n",
1753-
" \"model\": \"projects/116273516712/locations/us-central1/models/4400738115568795648\",\n",
1754-
" \"inputConfig\": {\n",
1755-
" \"instancesFormat\": \"jsonl\",\n",
1756-
" \"gcsSource\": {\n",
1757-
" \"uris\": [\n",
1758-
" \"gs://migration-ucaip-trainingaip-20210301154552/test.jsonl\"\n",
1759-
" ]\n",
1760-
" }\n",
1761-
" },\n",
1762-
" \"outputConfig\": {\n",
1763-
" \"predictionsFormat\": \"jsonl\",\n",
1764-
" \"gcsDestination\": {\n",
1765-
" \"outputUriPrefix\": \"gs://migration-ucaip-trainingaip-20210301154552/batch_output/\"\n",
1766-
" }\n",
1767-
" },\n",
1768-
" \"state\": \"JOB_STATE_PENDING\",\n",
1769-
" \"completionStats\": {\n",
1770-
" \"incompleteCount\": \"-1\"\n",
1771-
" },\n",
1772-
" \"createTime\": \"2021-03-01T17:59:42.777083Z\",\n",
1773-
" \"updateTime\": \"2021-03-01T17:59:42.777083Z\"\n",
1774-
"}\n",
1775-
"```\n"
1776-
]
1777-
},
17781653
{
17791654
"cell_type": "code",
17801655
"execution_count": null,
@@ -1798,19 +1673,6 @@
17981673
" time.sleep(60)"
17991674
]
18001675
},
1801-
{
1802-
"cell_type": "markdown",
1803-
"metadata": {
1804-
"id": "trainingpipelines_create:migration,new,response,icn"
1805-
},
1806-
"source": [
1807-
"*Example output*:\n",
1808-
"```\n",
1809-
"gs://migration-ucaip-trainingaip-20210301154552/batch_output/prediction-ten_20210301154552-2021-03-01T17:59:42.638222Z/predictions_00001.jsonl\n",
1810-
"{\"instance\":{\"content\":\"gs://migration-ucaip-trainingaip-20210301154552/test.txt\",\"mimeType\":\"text/plain\"},\"prediction\":{\"ids\":[\"7806436899697983488\",\"7806436899697983488\",\"7806436899697983488\",\"4347672385877442560\",\"4347672385877442560\",\"4347672385877442560\"],\"displayNames\":[\"SpecificDisease\",\"SpecificDisease\",\"SpecificDisease\",\"Modifier\",\"Modifier\",\"Modifier\"],\"textSegmentStartOffsets\":[\"149\",\"19\",\"169\",\"236\",\"688\",\"330\"],\"textSegmentEndOffsets\":[\"165\",\"45\",\"171\",\"238\",\"690\",\"332\"],\"confidences\":[0.99957836,0.9995628,0.9995044,0.9993287,0.9993144,0.99927235]}}\n",
1811-
"```\n"
1812-
]
1813-
},
18141676
{
18151677
"cell_type": "markdown",
18161678
"metadata": {
@@ -2338,11 +2200,11 @@
23382200
"id": "bQ-VVaSxJjkd"
23392201
},
23402202
"source": [
2341-
"# Cleaning up\r\n",
2342-
"\r\n",
2343-
"To clean up all GCP resources used in this project, you can [delete the GCP\r\n",
2344-
"project](https://cloud.google.com/resource-manager/docs/creating-managing-projects#shutting_down_projects) you used for the tutorial.\r\n",
2345-
"\r\n",
2203+
"# Cleaning up\n",
2204+
"\n",
2205+
"To clean up all GCP resources used in this project, you can [delete the GCP\n",
2206+
"project](https://cloud.google.com/resource-manager/docs/creating-managing-projects#shutting_down_projects) you used for the tutorial.\n",
2207+
"\n",
23462208
"Otherwise, you can delete the individual resources you created in this tutorial."
23472209
]
23482210
},
@@ -2404,7 +2266,7 @@
24042266
],
24052267
"metadata": {
24062268
"colab": {
2407-
"name": "UJ7 unified AutoML for natural language with Vertex AI Text Entity Extraction.ipynb",
2269+
"name": "UJ7 AutoML for natural language with Vertex AI Text Entity Extraction.ipynb",
24082270
"toc_visible": true
24092271
},
24102272
"kernelspec": {

notebooks/community/model_garden/model_garden_gemma_finetuning_on_vertex.ipynb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,9 @@
131131
"# @markdown > | Machine Type | Accelerator Type | Recommended Regions |\n",
132132
"# @markdown | ----------- | ----------- | ----------- |\n",
133133
"# @markdown | a2-ultragpu-1g | 1 NVIDIA_A100_80GB | us-central1, us-east4, europe-west4, asia-southeast1, us-east4 |\n",
134-
"# @markdown | a3-highgpu-8g | 8 NVIDIA_H100_80GB | us-central1, us-west1, europe-west4, asia-southeast1 |\n",
134+
"# @markdown | a3-highgpu-2g | 2 NVIDIA_H100_80GB | us-west1, asia-southeast1, europe-west4 |\n",
135+
"# @markdown | a3-highgpu-4g | 4 NVIDIA_H100_80GB | us-west1, asia-southeast1, europe-west4 |\n",
136+
"# @markdown | a3-highgpu-8g | 8 NVIDIA_H100_80GB | us-central1, us-east5, europe-west4, us-west1, asia-southeast1 |\n",
135137
"\n",
136138
"# @markdown 4. **[Optional]** [Create a Cloud Storage bucket](https://cloud.google.com/storage/docs/creating-buckets) for storing experiment outputs. Set the BUCKET_URI for the experiment environment. The specified Cloud Storage bucket (`BUCKET_URI`) should be located in the same region as where the notebook was launched. Note that a multi-region bucket (eg. \"us\") is not considered a match for a single region covered by the multi-region range (eg. \"us-central1\"). If not set, a unique GCS bucket will be created instead.\n",
137139
"\n",

notebooks/community/model_garden/model_garden_huggingface_tei_deployment.ipynb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,6 @@
129129
"\n",
130130
"models, endpoints = {}, {}\n",
131131
"\n",
132-
"# Dedicated endpoint not supported yet\n",
133-
"use_dedicated_endpoint = False\n",
134132
"HF_TOKEN = \"\""
135133
]
136134
},
@@ -217,6 +215,10 @@
217215
" return model, endpoint\n",
218216
"\n",
219217
"\n",
218+
"# @markdown Set use_dedicated_endpoint to False if you don't want to use [dedicated endpoint](https://cloud.google.com/vertex-ai/docs/general/deployment#create-dedicated-endpoint).\n",
219+
"use_dedicated_endpoint = True # @param {type:\"boolean\"}\n",
220+
"\n",
221+
"\n",
220222
"models[\"tei\"], endpoints[\"tei\"] = deploy_model_tei(\n",
221223
" model_name=common_util.get_job_name_with_datetime(prefix=MODEL_ID),\n",
222224
" model_id=MODEL_ID,\n",

notebooks/community/model_garden/model_garden_jax_owl_vit_v2.ipynb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,9 @@
123123
"# @markdown > | Machine Type | Accelerator Type | Recommended Regions |\n",
124124
"# @markdown | ----------- | ----------- | ----------- |\n",
125125
"# @markdown | a2-ultragpu-1g | 1 NVIDIA_A100_80GB | us-central1, us-east4, europe-west4, asia-southeast1, us-east4 |\n",
126-
"# @markdown | a3-highgpu-8g | 8 NVIDIA_H100_80GB | us-central1, us-west1, europe-west4, asia-southeast1 |\n",
126+
"# @markdown | a3-highgpu-2g | 2 NVIDIA_H100_80GB | us-west1, asia-southeast1, europe-west4 |\n",
127+
"# @markdown | a3-highgpu-4g | 4 NVIDIA_H100_80GB | us-west1, asia-southeast1, europe-west4 |\n",
128+
"# @markdown | a3-highgpu-8g | 8 NVIDIA_H100_80GB | us-central1, us-east5, europe-west4, us-west1, asia-southeast1 |\n",
127129
"\n",
128130
"import base64\n",
129131
"import datetime\n",

0 commit comments

Comments
 (0)