@@ -146,6 +146,27 @@ internal JsonNode CreateTuningJobConfigToMldev(JsonNode fromObject, JsonObject p
146146 throw new NotSupportedException ( "beta parameter is not supported in Gemini API." ) ;
147147 }
148148
149+ if ( ! Common . IsZero ( Common . GetValueByPath ( fromObject , new string [ ] { "baseTeacherModel" } ) ) ) {
150+ throw new NotSupportedException (
151+ "baseTeacherModel parameter is not supported in Gemini API." ) ;
152+ }
153+
154+ if ( ! Common . IsZero (
155+ Common . GetValueByPath ( fromObject , new string [ ] { "tunedTeacherModelSource" } ) ) ) {
156+ throw new NotSupportedException (
157+ "tunedTeacherModelSource parameter is not supported in Gemini API." ) ;
158+ }
159+
160+ if ( ! Common . IsZero (
161+ Common . GetValueByPath ( fromObject , new string [ ] { "sftLossWeightMultiplier" } ) ) ) {
162+ throw new NotSupportedException (
163+ "sftLossWeightMultiplier parameter is not supported in Gemini API." ) ;
164+ }
165+
166+ if ( ! Common . IsZero ( Common . GetValueByPath ( fromObject , new string [ ] { "outputUri" } ) ) ) {
167+ throw new NotSupportedException ( "outputUri parameter is not supported in Gemini API." ) ;
168+ }
169+
149170 return toObject ;
150171 }
151172
@@ -175,6 +196,14 @@ internal JsonNode CreateTuningJobConfigToVertex(JsonNode fromObject, JsonObject
175196 fromObject , new string [ ] { "validationDataset" } ) ) ) ,
176197 toObject , rootObject ) ) ;
177198 }
199+ } else if ( discriminatorValueValidationDataset == "DISTILLATION" ) {
200+ if ( Common . GetValueByPath ( fromObject , new string [ ] { "validationDataset" } ) != null ) {
201+ Common . SetValueByPath ( parentObject , new string [ ] { "distillationSpec" } ,
202+ TuningValidationDatasetToVertex (
203+ JsonNode . Parse ( JsonSerializer . Serialize ( Common . GetValueByPath (
204+ fromObject , new string [ ] { "validationDataset" } ) ) ) ,
205+ toObject , rootObject ) ) ;
206+ }
178207 }
179208 if ( Common . GetValueByPath ( fromObject , new string [ ] { "tunedModelDisplayName" } ) != null ) {
180209 Common . SetValueByPath (
@@ -206,6 +235,12 @@ internal JsonNode CreateTuningJobConfigToVertex(JsonNode fromObject, JsonObject
206235 new string [ ] { "preferenceOptimizationSpec" , "hyperParameters" , "epochCount" } ,
207236 Common . GetValueByPath ( fromObject , new string [ ] { "epochCount" } ) ) ;
208237 }
238+ } else if ( discriminatorValueEpochCount == "DISTILLATION" ) {
239+ if ( Common . GetValueByPath ( fromObject , new string [ ] { "epochCount" } ) != null ) {
240+ Common . SetValueByPath (
241+ parentObject , new string [ ] { "distillationSpec" , "hyperParameters" , "epochCount" } ,
242+ Common . GetValueByPath ( fromObject , new string [ ] { "epochCount" } ) ) ;
243+ }
209244 }
210245
211246 JsonNode discriminatorLearningRateMultiplier =
@@ -229,6 +264,13 @@ internal JsonNode CreateTuningJobConfigToVertex(JsonNode fromObject, JsonObject
229264 "learningRateMultiplier" } ,
230265 Common . GetValueByPath ( fromObject , new string [ ] { "learningRateMultiplier" } ) ) ;
231266 }
267+ } else if ( discriminatorValueLearningRateMultiplier == "DISTILLATION" ) {
268+ if ( Common . GetValueByPath ( fromObject , new string [ ] { "learningRateMultiplier" } ) != null ) {
269+ Common . SetValueByPath (
270+ parentObject ,
271+ new string [ ] { "distillationSpec" , "hyperParameters" , "learningRateMultiplier" } ,
272+ Common . GetValueByPath ( fromObject , new string [ ] { "learningRateMultiplier" } ) ) ;
273+ }
232274 }
233275
234276 JsonNode discriminatorExportLastCheckpointOnly =
@@ -252,6 +294,13 @@ internal JsonNode CreateTuningJobConfigToVertex(JsonNode fromObject, JsonObject
252294 new string [ ] { "preferenceOptimizationSpec" , "exportLastCheckpointOnly" } ,
253295 Common . GetValueByPath ( fromObject , new string [ ] { "exportLastCheckpointOnly" } ) ) ;
254296 }
297+ } else if ( discriminatorValueExportLastCheckpointOnly == "DISTILLATION" ) {
298+ if ( Common . GetValueByPath ( fromObject , new string [ ] { "exportLastCheckpointOnly" } ) !=
299+ null ) {
300+ Common . SetValueByPath (
301+ parentObject , new string [ ] { "distillationSpec" , "exportLastCheckpointOnly" } ,
302+ Common . GetValueByPath ( fromObject , new string [ ] { "exportLastCheckpointOnly" } ) ) ;
303+ }
255304 }
256305
257306 JsonNode discriminatorAdapterSize =
@@ -273,6 +322,12 @@ internal JsonNode CreateTuningJobConfigToVertex(JsonNode fromObject, JsonObject
273322 new string [ ] { "preferenceOptimizationSpec" , "hyperParameters" , "adapterSize" } ,
274323 Common . GetValueByPath ( fromObject , new string [ ] { "adapterSize" } ) ) ;
275324 }
325+ } else if ( discriminatorValueAdapterSize == "DISTILLATION" ) {
326+ if ( Common . GetValueByPath ( fromObject , new string [ ] { "adapterSize" } ) != null ) {
327+ Common . SetValueByPath (
328+ parentObject , new string [ ] { "distillationSpec" , "hyperParameters" , "adapterSize" } ,
329+ Common . GetValueByPath ( fromObject , new string [ ] { "adapterSize" } ) ) ;
330+ }
276331 }
277332 if ( ! Common . IsZero ( Common . GetValueByPath ( fromObject , new string [ ] { "batchSize" } ) ) ) {
278333 throw new NotSupportedException ( "batchSize parameter is not supported in Vertex AI." ) ;
@@ -293,6 +348,30 @@ internal JsonNode CreateTuningJobConfigToVertex(JsonNode fromObject, JsonObject
293348 Common . GetValueByPath ( fromObject , new string [ ] { "beta" } ) ) ;
294349 }
295350
351+ if ( Common . GetValueByPath ( fromObject , new string [ ] { "baseTeacherModel" } ) != null ) {
352+ Common . SetValueByPath (
353+ parentObject , new string [ ] { "distillationSpec" , "baseTeacherModel" } ,
354+ Common . GetValueByPath ( fromObject , new string [ ] { "baseTeacherModel" } ) ) ;
355+ }
356+
357+ if ( Common . GetValueByPath ( fromObject , new string [ ] { "tunedTeacherModelSource" } ) != null ) {
358+ Common . SetValueByPath (
359+ parentObject , new string [ ] { "distillationSpec" , "tunedTeacherModelSource" } ,
360+ Common . GetValueByPath ( fromObject , new string [ ] { "tunedTeacherModelSource" } ) ) ;
361+ }
362+
363+ if ( Common . GetValueByPath ( fromObject , new string [ ] { "sftLossWeightMultiplier" } ) != null ) {
364+ Common . SetValueByPath (
365+ parentObject ,
366+ new string [ ] { "distillationSpec" , "hyperParameters" , "sftLossWeightMultiplier" } ,
367+ Common . GetValueByPath ( fromObject , new string [ ] { "sftLossWeightMultiplier" } ) ) ;
368+ }
369+
370+ if ( Common . GetValueByPath ( fromObject , new string [ ] { "outputUri" } ) != null ) {
371+ Common . SetValueByPath ( parentObject , new string [ ] { "outputUri" } ,
372+ Common . GetValueByPath ( fromObject , new string [ ] { "outputUri" } ) ) ;
373+ }
374+
296375 return toObject ;
297376 }
298377
@@ -586,6 +665,12 @@ internal JsonNode TuningDatasetToVertex(JsonNode fromObject, JsonObject parentOb
586665 new string [ ] { "preferenceOptimizationSpec" , "trainingDatasetUri" } ,
587666 Common . GetValueByPath ( fromObject , new string [ ] { "gcsUri" } ) ) ;
588667 }
668+ } else if ( discriminatorValueGcsUri == "DISTILLATION" ) {
669+ if ( Common . GetValueByPath ( fromObject , new string [ ] { "gcsUri" } ) != null ) {
670+ Common . SetValueByPath ( parentObject ,
671+ new string [ ] { "distillationSpec" , "promptDatasetUri" } ,
672+ Common . GetValueByPath ( fromObject , new string [ ] { "gcsUri" } ) ) ;
673+ }
589674 }
590675
591676 JsonNode discriminatorVertexDatasetResource =
@@ -606,6 +691,12 @@ internal JsonNode TuningDatasetToVertex(JsonNode fromObject, JsonObject parentOb
606691 parentObject , new string [ ] { "preferenceOptimizationSpec" , "trainingDatasetUri" } ,
607692 Common . GetValueByPath ( fromObject , new string [ ] { "vertexDatasetResource" } ) ) ;
608693 }
694+ } else if ( discriminatorValueVertexDatasetResource == "DISTILLATION" ) {
695+ if ( Common . GetValueByPath ( fromObject , new string [ ] { "vertexDatasetResource" } ) != null ) {
696+ Common . SetValueByPath (
697+ parentObject , new string [ ] { "distillationSpec" , "promptDatasetUri" } ,
698+ Common . GetValueByPath ( fromObject , new string [ ] { "vertexDatasetResource" } ) ) ;
699+ }
609700 }
610701 if ( ! Common . IsZero ( Common . GetValueByPath ( fromObject , new string [ ] { "examples" } ) ) ) {
611702 throw new NotSupportedException ( "examples parameter is not supported in Vertex AI." ) ;
@@ -756,6 +847,12 @@ internal JsonNode TuningJobFromVertex(JsonNode fromObject, JsonObject parentObje
756847 Common . GetValueByPath ( fromObject , new string [ ] { "preferenceOptimizationSpec" } ) ) ;
757848 }
758849
850+ if ( Common . GetValueByPath ( fromObject , new string [ ] { "distillationSpec" } ) != null ) {
851+ Common . SetValueByPath (
852+ toObject , new string [ ] { "distillationSpec" } ,
853+ Common . GetValueByPath ( fromObject , new string [ ] { "distillationSpec" } ) ) ;
854+ }
855+
759856 if ( Common . GetValueByPath ( fromObject , new string [ ] { "tuningDataStats" } ) != null ) {
760857 Common . SetValueByPath (
761858 toObject , new string [ ] { "tuningDataStats" } ,
0 commit comments