File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed
generative_ai/model_tuning Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -40,14 +40,16 @@ def gemini_tuning_advanced() -> sft.SupervisedTuningJob:
40
40
# vertexai.init(encryption_spec_key_name="your-kms-key")
41
41
42
42
sft_tuning_job = sft .train (
43
- source_model = "gemini-1.5-pro-002" ,
43
+ source_model = "gemini-2.0-flash-001" ,
44
+ # 1.5 and 2.0 models use the same JSONL format
44
45
train_dataset = "gs://cloud-samples-data/ai-platform/generative_ai/gemini-1_5/text/sft_train_data.jsonl" ,
45
46
# The following parameters are optional
46
47
validation_dataset = "gs://cloud-samples-data/ai-platform/generative_ai/gemini-1_5/text/sft_validation_data.jsonl" ,
47
- epochs = 4 ,
48
- adapter_size = 4 ,
49
- learning_rate_multiplier = 1.0 ,
50
- tuned_model_display_name = "tuned_gemini_1_5_pro" ,
48
+ tuned_model_display_name = "tuned_gemini_2_0_flash" ,
49
+ # Advanced use only below. It is recommended to use auto-selection and leave them unset
50
+ # epochs=4,
51
+ # adapter_size=4,
52
+ # learning_rate_multiplier=1.0,
51
53
)
52
54
53
55
# Polling for job completion
Original file line number Diff line number Diff line change @@ -32,7 +32,8 @@ def gemini_tuning_basic() -> sft.SupervisedTuningJob:
32
32
vertexai .init (project = PROJECT_ID , location = "us-central1" )
33
33
34
34
sft_tuning_job = sft .train (
35
- source_model = "gemini-1.5-pro-002" ,
35
+ source_model = "gemini-2.0-flash-001" ,
36
+ # 1.5 and 2.0 models use the same JSONL format
36
37
train_dataset = "gs://cloud-samples-data/ai-platform/generative_ai/gemini-1_5/text/sft_train_data.jsonl" ,
37
38
)
38
39
You can’t perform that action at this time.
0 commit comments