Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"id": "view-in-github"
},
"source": [
"<a href=\"https://colab.research.google.com/github/Narwhalprime/vertex-ai-samples/blob/main/notebooks/community/pipelines/google_cloud_pipeline_components_ready_to_go_text_classification_pipeline.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
"<a href=\"https://colab.research.google.com/github/Narwhalprime/vertex-ai-samples/blob/ready_to_go_notebook_fix/notebooks/community/pipelines/google_cloud_pipeline_components_ready_to_go_text_classification_pipeline.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
Expand Down Expand Up @@ -53,7 +53,7 @@
" </a>\n",
" </td>\n",
" <td>\n",
" <a href=\"https://console.cloud.google.com/ai/platform/notebooks/deploy-notebook?download_url=https://github.com/GoogleCloudPlatform/vertex-ai-samples/blob/main/community-content/ready_to_go_text_classification_pipeline/ready_to_go_text_classification_pipeline.ipynb\">\n",
" <a href=\"https://console.cloud.google.com/ai/platform/notebooks/deploy-notebook?download_url=https://github.com/GoogleCloudPlatform/vertex-ai-samples/blob/main/notebooks/community/pipelines/google_cloud_pipeline_components_ready_to_go_text_classification_pipeline.ipynb\">\n",
" <img src=\"https://lh3.googleusercontent.com/UiNooY4LUgW_oTvpsNhPpQzsstV5W8F7rYgxgGBD85cWJoLmrOzhVs_ksK_vgx40SHs7jCqkTkCk=e14-rj-sc0xffffff-h130-w32\" alt=\"Vertex AI logo\">\n",
" Open in Vertex AI Workbench\n",
" </a>\n",
Expand Down Expand Up @@ -179,6 +179,8 @@
"source": [
"### Install additional packages\n",
"\n",
"NOTE: This notebook relies on components from an older version of the Google Cloud Pipeline Components library (GCPC).\n",
"\n",
"Install the following packages required to execute this notebook."
]
},
Expand Down Expand Up @@ -212,7 +214,7 @@
},
"outputs": [],
"source": [
"! pip3 install --upgrade pip google-cloud-aiplatform google-cloud-pipeline-components kfp tensorflow tensorboard numpy {USER_FLAG} -q"
"! pip3 install --upgrade pip google-cloud-aiplatform 'google-cloud-pipeline-components<2' kfp tensorflow tensorboard numpy {USER_FLAG} -q"
]
},
{
Expand Down Expand Up @@ -286,35 +288,11 @@
"source": [
"#### Set your project ID\n",
"\n",
"**If you don't know your project ID**, you may be able to get your project ID using `gcloud`."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "oM1iC_MfAts1"
},
"outputs": [],
"source": [
"import os\n",
"\n",
"PROJECT_ID = \"\"\n",
"**Set your project ID (*not* project number) here**. If you don't know your project ID, try the following:\n",
"\n",
"# Get your Google Cloud project ID from gcloud\n",
"if not os.getenv(\"IS_TESTING\"):\n",
" shell_output = !gcloud config list --format 'value(core.project)' 2>/dev/null\n",
" PROJECT_ID = shell_output[0]\n",
" print(\"Project ID: \", PROJECT_ID)"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "qJYoRfYng0XZ"
},
"source": [
"Otherwise, set your project ID here."
"* Run `gcloud config list`.\n",
"* Run `gcloud projects list`.\n",
"* See the support page: Locate the project ID"
]
},
{
Expand All @@ -325,19 +303,8 @@
},
"outputs": [],
"source": [
"if PROJECT_ID == \"\" or PROJECT_ID is None:\n",
" PROJECT_ID = \"\" # @param {type:\"string\"}"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "set_gcloud_project_id"
},
"outputs": [],
"source": [
"! gcloud config set project $PROJECT_ID"
"PROJECT_ID = \"[your-project-id-here]\" # @param {type:\"string\"}\n",
"!gcloud config set project $PROJECT_ID"
]
},
{
Expand Down Expand Up @@ -706,7 +673,7 @@
")\n",
"\n",
"# The GCS directory for keeping staging files for model evaluation.\n",
"ROOT_DIR = \"'f\\\"{BASE_OUTPUT_DIR}/root\\\"'\" # @param {type:\"string\"}"
"ROOT_DIR = f\"{BASE_OUTPUT_DIR}/root\" # @param {type:\"string\"}"
]
},
{
Expand Down Expand Up @@ -898,7 +865,6 @@
" num_epochs: int = 5,\n",
" random_seed: int = 0,\n",
") -> None:\n",
"\n",
" \"\"\"End-to-end text classification pipeline.\n",
"\n",
" Args:\n",
Expand Down Expand Up @@ -1080,6 +1046,7 @@
" location=REGION,\n",
" enable_caching=True,\n",
" parameter_values=parameters,\n",
" project=PROJECT_ID,\n",
")\n",
"\n",
"job.submit(service_account=SERVICE_ACCOUNT)"
Expand Down