GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: add bq table arg · googleapis/python-aiplatform@5a415a0

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • google/cloud/aiplatform
    • training_jobs.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎google/cloud/aiplatform/training_jobs.py‎

Copy file name to clipboardExpand all lines: google/cloud/aiplatform/training_jobs.py
+22-1Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ def _create_input_data_config(
121121
test_fraction_split: float = 0.1,
122122
predefined_split_column_name: Optional[str] = None,
123123
gcs_destination_uri_prefix: Optional[str] = None,
124+
bigquery_destination: Optional[str] = None
124125
) -> Optional[gca_training_pipeline.InputDataConfig]:
125126
"""Constructs a input data config to pass to the training pipeline.
126127
@@ -159,6 +160,8 @@ def _create_input_data_config(
159160
- AIP_TRAINING_DATA_URI = "gcs_destination/training-*"
160161
- AIP_VALIDATION_DATA_URI = "gcs_destination/validation-*"
161162
- AIP_TEST_DATA_URI = "gcs_destination/test-*".
163+
bigquery_destination (str):
164+
TODO(asobran)
162165
"""
163166

164167
input_data_config = None
@@ -192,12 +195,18 @@ def _create_input_data_config(
192195
output_uri_prefix=gcs_destination_uri_prefix
193196
)
194197

198+
bigquery_destination_proto=None
199+
if bigquery_destination:
200+
bigquery_destination_proto = gca_io.BigQueryDestination(
201+
output_uri=bigquery_destination)
202+
195203
# create input data config
196204
input_data_config = gca_training_pipeline.InputDataConfig(
197205
fraction_split=fraction_split,
198206
predefined_split=predefined_split,
199207
dataset_id=dataset.name,
200208
gcs_destination=gcs_destination,
209+
bigquery_destination=bigquery_destination_proto
201210
)
202211

203212
return input_data_config
@@ -213,6 +222,7 @@ def _run_job(
213222
predefined_split_column_name: Optional[str] = None,
214223
model: Optional[gca_model.Model] = None,
215224
gcs_destination_uri_prefix: Optional[str] = None,
225+
bigquery_destination: Optional[str] = None
216226
) -> Optional[models.Model]:
217227
"""Runs the training job.
218228
@@ -294,6 +304,8 @@ def _run_job(
294304
- AIP_TRAINING_DATA_URI = "gcs_destination/training-*"
295305
- AIP_VALIDATION_DATA_URI = "gcs_destination/validation-*"
296306
- AIP_TEST_DATA_URI = "gcs_destination/test-*".
307+
bigquery_destination (str):
308+
TODO(asobran)
297309
"""
298310

299311
input_data_config = self._create_input_data_config(
@@ -303,6 +315,7 @@ def _run_job(
303315
test_fraction_split=test_fraction_split,
304316
predefined_split_column_name=predefined_split_column_name,
305317
gcs_destination_uri_prefix=gcs_destination_uri_prefix,
318+
bigquery_destination=bigquery_destination
306319
)
307320

308321
# create training pipeline
@@ -1157,6 +1170,7 @@ def run(
11571170
dataset: Optional[datasets.Dataset] = None,
11581171
model_display_name: Optional[str] = None,
11591172
base_output_dir: Optional[str] = None,
1173+
bigquery_destination: Optional[str] = None,
11601174
args: Optional[List[Union[str, float, int]]] = None,
11611175
replica_count: int = 0,
11621176
machine_type: str = "n1-standard-4",
@@ -1186,7 +1200,7 @@ def run(
11861200
Args:
11871201
dataset (aiplatform.Dataset):
11881202
AI Platform to fit this training against. Custom training script should
1189-
retrieve datasets through passed in environement variables uris:
1203+
retrieve datasets through passed in environment variables uris:
11901204
11911205
os.environ["AIP_TRAINING_DATA_URI"]
11921206
os.environ["AIP_VALIDATION_DATA_URI"]
@@ -1202,6 +1216,8 @@ def run(
12021216
base_output_dir (str):
12031217
GCS output directory of job. If not provided a
12041218
timestamped directory in the staging directory will be used.
1219+
bigquery_destination (str):
1220+
TODO(asobran)
12051221
args (List[Unions[str, int, float]]):
12061222
Command line arguments to be passed to the Python script.
12071223
replica_count (int):
@@ -1291,6 +1307,7 @@ def run(
12911307
managed_model=managed_model,
12921308
args=args,
12931309
base_output_dir=base_output_dir,
1310+
bigquery_destination=bigquery_destination,
12941311
training_fraction_split=training_fraction_split,
12951312
validation_fraction_split=validation_fraction_split,
12961313
test_fraction_split=test_fraction_split,
@@ -1307,6 +1324,7 @@ def _run(
13071324
managed_model: Optional[gca_model.Model] = None,
13081325
args: Optional[List[Union[str, float, int]]] = None,
13091326
base_output_dir: Optional[str] = None,
1327+
bigquery_destination: Optional[str] = None,
13101328
training_fraction_split: float = 0.8,
13111329
validation_fraction_split: float = 0.1,
13121330
test_fraction_split: float = 0.1,
@@ -1328,6 +1346,8 @@ def _run(
13281346
base_output_dir (str):
13291347
GCS output directory of job. If not provided a
13301348
timestamped directory in the staging directory will be used.
1349+
bigquery_destination (str):
1350+
TODO(asobran)
13311351
training_fraction_split (float):
13321352
The fraction of the input data that is to be
13331353
used to train the Model.
@@ -1394,6 +1414,7 @@ def _run(
13941414
predefined_split_column_name=predefined_split_column_name,
13951415
model=managed_model,
13961416
gcs_destination_uri_prefix=base_output_dir,
1417+
bigquery_destination=bigquery_destination
13971418
)
13981419

13991420
return model

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.