15
15
16
16
17
17
@dsl .pipeline (name = _PIPELINE_NAME )
18
- def llm_eval_classification_pipeline ( # pylint: disable=dangerous-default-value
18
+ def evaluation_llm_classification_pipeline ( # pylint: disable=dangerous-default-value
19
19
project : str ,
20
20
location : str ,
21
21
target_field_name : str ,
22
+ batch_predict_gcs_source_uris : List [str ],
22
23
batch_predict_gcs_destination_output_uri : str ,
23
24
model_name : str = 'publishers/google/models/text-bison@001' ,
24
25
evaluation_task : str = 'text-classification' ,
25
26
evaluation_class_labels : List [str ] = [],
26
27
batch_predict_instances_format : str = 'jsonl' ,
27
- batch_predict_gcs_source_uris : List [str ] = [],
28
28
batch_predict_predictions_format : str = 'jsonl' ,
29
29
machine_type : str = 'e2-highmem-16' ,
30
30
service_account : str = '' ,
@@ -49,6 +49,13 @@ def llm_eval_classification_pipeline( # pylint: disable=dangerous-default-value
49
49
target_field_name: The target field's name. Formatted to be able to find
50
50
nested columns, delimited by ``.``. Prefixed with 'instance.' on the
51
51
component for Vertex Batch Prediction.
52
+ batch_predict_gcs_source_uris: Google Cloud Storage URI(-s) to your
53
+ instances data to run batch prediction on. The instances data should also
54
+ contain the ground truth (target) data, used for evaluation. May contain
55
+ wildcards. For more information on wildcards, see
56
+ https://cloud.google.com/storage/docs/gsutil/addlhelp/WildcardNames. For
57
+ more details about this input config, see
58
+ https://cloud.google.com/vertex-ai/docs/reference/rest/v1/projects.locations.batchPredictionJobs#InputConfig.
52
59
batch_predict_gcs_destination_output_uri: The Google Cloud Storage location
53
60
of the directory where the output is to be written to.
54
61
model_name: The Model name used to run evaluation. Must be a publisher Model
@@ -65,13 +72,6 @@ def llm_eval_classification_pipeline( # pylint: disable=dangerous-default-value
65
72
must be one of the Model's supportedInputStorageFormats. For more details
66
73
about this input config, see
67
74
https://cloud.google.com/vertex-ai/docs/reference/rest/v1/projects.locations.batchPredictionJobs#InputConfig.
68
- batch_predict_gcs_source_uris: Google Cloud Storage URI(-s) to your
69
- instances data to run batch prediction on. The instances data should also
70
- contain the ground truth (target) data, used for evaluation. May contain
71
- wildcards. For more information on wildcards, see
72
- https://cloud.google.com/storage/docs/gsutil/addlhelp/WildcardNames. For
73
- more details about this input config, see
74
- https://cloud.google.com/vertex-ai/docs/reference/rest/v1/projects.locations.batchPredictionJobs#InputConfig.
75
75
batch_predict_predictions_format: The format in which Vertex AI gives the
76
76
predictions. Must be one of the Model's supportedOutputStorageFormats. For
77
77
more details about this output config, see
@@ -113,19 +113,18 @@ def llm_eval_classification_pipeline( # pylint: disable=dangerous-default-value
113
113
created.
114
114
115
115
Returns:
116
- NamedTuple:
117
- evaluation_metrics: ClassificationMetrics Artifact for LLM Text
118
- Classification.
119
- evaluation_resource_name: If run on an user's managed VertexModel, the
120
- imported evaluation resource name. Empty if run on a publisher model.
116
+ evaluation_metrics: ClassificationMetrics Artifact for LLM Text
117
+ Classification.
118
+ evaluation_resource_name: If run on an user's managed VertexModel, the
119
+ imported evaluation resource name. Empty if run on a publisher model.
121
120
"""
122
121
outputs = NamedTuple (
123
122
'outputs' ,
124
123
evaluation_metrics = ClassificationMetrics ,
125
124
evaluation_resource_name = str ,
126
125
)
127
126
128
- get_vertex_model_task = dsl .importer_node . importer (
127
+ get_vertex_model_task = dsl .importer (
129
128
artifact_uri = (
130
129
f'https://{ location } -aiplatform.googleapis.com/v1/{ model_name } '
131
130
),
0 commit comments