Skip to content

Commit dd85741

Browse files
authored
samples: fixed wrong format on GCS input Uri [(#4270)](GoogleCloudPlatform/python-docs-samples#4270)
## Description Current predict sample indicates that it can multiples GCS URI inputs but it should be singular. ## Checklist - [X] Please **merge** this PR for me once it is approved.
1 parent 26a0653 commit dd85741

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

samples/tables/automl_tables_predict.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def batch_predict(
8585
project_id,
8686
compute_region,
8787
model_display_name,
88-
gcs_input_uris,
88+
gcs_input_uri,
8989
gcs_output_uri,
9090
):
9191
"""Make a batch of predictions."""
@@ -94,17 +94,19 @@ def batch_predict(
9494
# project_id = 'PROJECT_ID_HERE'
9595
# compute_region = 'COMPUTE_REGION_HERE'
9696
# model_display_name = 'MODEL_DISPLAY_NAME_HERE'
97-
# gcs_input_uris = ['gs://path/to/file.csv]
98-
# gcs_output_uri = 'gs://path'
97+
# gcs_input_uri = 'gs://YOUR_BUCKET_ID/path_to_your_input_csv'
98+
# gcs_output_uri = 'gs://YOUR_BUCKET_ID/path_to_save_results/'
9999

100100
from google.cloud import automl_v1beta1 as automl
101101

102102
client = automl.TablesClient(project=project_id, region=compute_region)
103103

104104
# Query model
105-
response = client.batch_predict(gcs_input_uris=gcs_input_uris,
106-
gcs_output_uri_prefix=gcs_output_uri,
107-
model_display_name=model_display_name)
105+
response = client.batch_predict(
106+
gcs_input_uris=gcs_input_uri,
107+
gcs_output_uri_prefix=gcs_output_uri,
108+
model_display_name=model_display_name,
109+
)
108110
print("Making batch prediction... ")
109111
response.result()
110112
print("Batch prediction complete.\n{}".format(response.metadata))

0 commit comments

Comments
 (0)