Skip to content

Commit 3455111

Browse files
author
Lehui Liu
authored
Update supervised_advanced_example.py to support byosa and cmek (#12978)
* Update supervised_advanced_example.py to support byosa and cmek * Add CMEK and BYOSA example to advanced snippets
1 parent b424d9e commit 3455111

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

generative_ai/model_tuning/supervised_advanced_example.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@ def gemini_tuning_advanced() -> sft.SupervisedTuningJob:
3131
# PROJECT_ID = "your-project-id"
3232
vertexai.init(project=PROJECT_ID, location="us-central1")
3333

34+
# Initialize Vertex AI with your service account for BYOSA (Bring Your Own Service Account).
35+
# Uncomment the following and replace "your-service-account"
36+
# vertexai.init(service_account="your-service-account")
37+
38+
39+
# Initialize Vertex AI with your CMEK (Customer-Managed Encryption Key).
40+
# Un-comment the following line and replace "your-kms-key"
41+
# vertexai.init(encryption_spec_key_name="your-kms-key")
42+
3443
sft_tuning_job = sft.train(
3544
source_model="gemini-1.5-pro-002",
3645
train_dataset="gs://cloud-samples-data/ai-platform/generative_ai/gemini-1_5/text/sft_train_data.jsonl",

0 commit comments

Comments
 (0)