Skip to content

Bug Bash 2026-08: Make supervised tuning colab executable - #78

Open
msd2178 wants to merge 1 commit into
googlemaps-samples:feat/street-view-samplesfrom
msd2178:supervised_tuning
Open

Bug Bash 2026-08: Make supervised tuning colab executable#78
msd2178 wants to merge 1 commit into
googlemaps-samples:feat/street-view-samplesfrom
msd2178:supervised_tuning

Conversation

@msd2178

@msd2178 msd2178 commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Summary of changes:

Priority Description
P1 Replaced hardcoded local desktop file paths (/Users/...) with wget to dynamically download the training dataset directly from the GitHub repository.
P1 Added a data-cleaning cell to verify and filter out inaccessible https:// URLs from the training dataset, preventing Vertex AI fine-tuning jobs from failing.
P1 Updated the BigQuery SELECT query to use configuration variables instead of the hardcoded sarthaks-lab project and utility_pole_evaluations table.
P2 Updated the BigQuery query to match the new schema (using asset_type instead of type, and aggregating the singular gcs_uri column).
P2 Migrated model initialization, fine-tuning, and content generation from the deprecated vertexai SDK to the new google-genai SDK.

@msd2178 msd2178 self-assigned this Aug 10, 2026
"BIGQUERY_TABLE_ID = 'cropped_observations_all' # @param {type:\"string\"}\n",
"QUERY_LIMIT = 10 # @param {type:\"integer\"}\n",
"ASSET_TYPE = \"ASSET_CLASS_UTILITY_POLE\" # @param {type:\"string\"}\n",
"MODEL = \"gemini-2.5-flash\" # @param {type:\"string\"}\n"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gemini-2.5-flash will be deprecated in October.

Can this be upgraded?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: I was able to get it to load with gemini-3.5-flash, but not gemini-3.6-flash

"\n",
"# BigQuery Configuration\n",
"BIGQUERY_DATASET_ID = '' # @param {type:\"string\"}\n",
"BIGQUERY_TABLE_ID = 'cropped_observations_all' # @param {type:\"string\"}\n",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this notebook require data from all available historical snapshots?

Or is it sufficient to use cropped_observations_latest?

"import os\n",
"\n",
"# 1. Define the base path and the training file name\n",
"BASE_URL = \"https://raw.githubusercontent.com/googlemaps-samples/insights-samples/feat/street-view-samples/street_view_insights/cropped/notebooks/Supervised%20fine%20tuning/data/\"\n",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please construct this URL using parameters with these default values:

 "GITHUB_REPOSITORY_NAME = 'googlemaps-samples/insights-samples' # @param {type:\"string\"}\n",
 "GITHUB_BRANCH_NAME = 'main' # @param {type:\"string\"}\n"

See here for a comparative example.

This will allow you to test from your branch (with variable overrides), but then ensure it still works after your code is merged.

"outputs": [],
"source": [
"# Install the necessary library\n",
"!pip install --upgrade --user --quiet google-genai google-cloud-aiplatform\n",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: This package installation step should move to a separate cell near the top of the file.

"id": "1-2-3-4-5"
},
"source": [
"## Setup\n",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this cell move earlier in the notebook?

"# Provide a bucket name\n",
"BUCKET_NAME = \"\" # @param {type:\"string\"}\n",
"BUCKET_URI = f\"gs://{BUCKET_NAME}\"\n",
"# LOCATION = \"us\"\n",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Uncomment LOCATION on line 112.
  2. Change --location {REGION} -> --location {LOCATION} on line 115.

" AND gcs_uri IS NOT NULL\n",
" GROUP BY\n",
" asset_id\n",
" LIMIT 100\n",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LIMIT 100 -> LIMIT {QUERY_LIMIT}

"BIGQUERY_TABLE_ID = 'cropped_observations_all' # @param {type:\"string\"}\n",
"QUERY_LIMIT = 10 # @param {type:\"integer\"}\n",
"ASSET_TYPE = \"ASSET_CLASS_UTILITY_POLE\" # @param {type:\"string\"}\n",
"MODEL = \"gemini-2.5-flash\" # @param {type:\"string\"}\n"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: I was able to get it to load with gemini-3.5-flash, but not gemini-3.6-flash

},
"outputs": [],
"source": [
"# Provide a bucket name\n",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got the following error when running with a bucket on my playground project:

400 FAILED_PRECONDITION. {'error': {'code': 400, 'message': 'Service account `[service-631865656917@gcp-sa-vertex-tune.iam.gserviceaccount.com](mailto:service-631865656917@gcp-sa-vertex-tune.iam.gserviceaccount.com)` does not have `[storage.objects.get]` IAM permission(s) to the file "gs://bijanv-geosptial-demos/data/acquity_detector_negative_examples_v2_clean.jsonl". Please either copy the files to the Google Cloud Storage bucket owned by your project, or grant the required IAM permission(s) to the service account.', 'status': 'FAILED_PRECONDITION'}}

Please add a Markdown cell above this indicating that the bucket in use my provide the above service agent (exclude the project ID) with roles/storage.objectViewer access

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants