File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3131_SUPPORTED_PUBLISHERS = ["google" ]
3232
3333_SHORT_MODEL_ID_TO_TUNING_PIPELINE_MAP = {
34- "text-bison" : "https://us-kfp.pkg.dev/ml-pipeline/large-language-model-pipelines/tune-large-model/v2.0.0"
34+ "text-bison" : "https://us-kfp.pkg.dev/ml-pipeline/large-language-model-pipelines/tune-large-model/v2.0.0" ,
35+ "code-bison" : "https://us-kfp.pkg.dev/ml-pipeline/large-language-model-pipelines/tune-large-model/v3.0.0" ,
3536}
3637
3738_SDK_PRIVATE_PREVIEW_LAUNCH_STAGE = frozenset (
Original file line number Diff line number Diff line change @@ -54,7 +54,9 @@ def _get_model_id_from_tuning_model_id(tuning_model_id: str) -> str:
5454 return tuning_model_id .replace (
5555 "text-bison-" , "publishers/google/models/text-bison@"
5656 )
57- raise ValueError (f"Unsupported tuning model ID { tuning_model_id } " )
57+ if "/" not in tuning_model_id :
58+ return "publishers/google/models/" + tuning_model_id
59+ return tuning_model_id
5860
5961
6062class _LanguageModel (_model_garden_models ._ModelGardenModel ):
@@ -1007,6 +1009,10 @@ def predict(
10071009 )
10081010
10091011
1012+ class _PreviewCodeGenerationModel (CodeGenerationModel , _TunableModelMixin ):
1013+ _LAUNCH_STAGE = _model_garden_models ._SDK_PUBLIC_PREVIEW_LAUNCH_STAGE
1014+
1015+
10101016###### Model tuning
10111017# Currently, tuning can only work in this location
10121018_TUNING_LOCATIONS = ("europe-west4" , "us-central1" )
Original file line number Diff line number Diff line change 1616
1717from vertexai .language_models ._language_models import (
1818 _PreviewChatModel ,
19+ _PreviewCodeGenerationModel ,
1920 _PreviewTextEmbeddingModel ,
2021 _PreviewTextGenerationModel ,
2122 ChatMessage ,
2223 ChatModel ,
2324 ChatSession ,
2425 CodeChatModel ,
2526 CodeChatSession ,
26- CodeGenerationModel ,
2727 InputOutputTextPair ,
2828 TextEmbedding ,
2929 TextGenerationResponse ,
3030)
3131
3232ChatModel = _PreviewChatModel
33+ CodeGenerationModel = _PreviewCodeGenerationModel
3334TextGenerationModel = _PreviewTextGenerationModel
3435TextEmbeddingModel = _PreviewTextEmbeddingModel
3536
You can’t perform that action at this time.
0 commit comments