File tree 3 files changed +11
-3
lines changed
3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 31
31
_SUPPORTED_PUBLISHERS = ["google" ]
32
32
33
33
_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" ,
35
36
}
36
37
37
38
_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:
54
54
return tuning_model_id .replace (
55
55
"text-bison-" , "publishers/google/models/text-bison@"
56
56
)
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
58
60
59
61
60
62
class _LanguageModel (_model_garden_models ._ModelGardenModel ):
@@ -1007,6 +1009,10 @@ def predict(
1007
1009
)
1008
1010
1009
1011
1012
+ class _PreviewCodeGenerationModel (CodeGenerationModel , _TunableModelMixin ):
1013
+ _LAUNCH_STAGE = _model_garden_models ._SDK_PUBLIC_PREVIEW_LAUNCH_STAGE
1014
+
1015
+
1010
1016
###### Model tuning
1011
1017
# Currently, tuning can only work in this location
1012
1018
_TUNING_LOCATIONS = ("europe-west4" , "us-central1" )
Original file line number Diff line number Diff line change 16
16
17
17
from vertexai .language_models ._language_models import (
18
18
_PreviewChatModel ,
19
+ _PreviewCodeGenerationModel ,
19
20
_PreviewTextEmbeddingModel ,
20
21
_PreviewTextGenerationModel ,
21
22
ChatMessage ,
22
23
ChatModel ,
23
24
ChatSession ,
24
25
CodeChatModel ,
25
26
CodeChatSession ,
26
- CodeGenerationModel ,
27
27
InputOutputTextPair ,
28
28
TextEmbedding ,
29
29
TextGenerationResponse ,
30
30
)
31
31
32
32
ChatModel = _PreviewChatModel
33
+ CodeGenerationModel = _PreviewCodeGenerationModel
33
34
TextGenerationModel = _PreviewTextGenerationModel
34
35
TextEmbeddingModel = _PreviewTextEmbeddingModel
35
36
You can’t perform that action at this time.
0 commit comments