Skip to content

Commit 5de6553

Browse files
gcf-owl-bot[bot]pattishin
authored andcommitted
chore: new owl bot post processor docker image (#121)
gcr.io/repo-automation-bots/owlbot-nodejs:latest@sha256:f93bb861d6f12574437bb9aee426b71eafd63b419669ff0ed029f4b7e7162e3f
1 parent 37cdd4f commit 5de6553

16 files changed

+70
-92
lines changed

ai-platform/snippets/create-training-pipeline-image-classification.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,8 @@ function main(
3838
// Imports the Google Cloud Pipeline Service Client library
3939
const aiplatform = require('@google-cloud/aiplatform');
4040

41-
const {
42-
definition,
43-
} = aiplatform.protos.google.cloud.aiplatform.v1.schema.trainingjob;
41+
const {definition} =
42+
aiplatform.protos.google.cloud.aiplatform.v1.schema.trainingjob;
4443
const ModelType = definition.AutoMlImageClassificationInputs.ModelType;
4544

4645
// Specifies the location of the api endpoint
@@ -57,14 +56,13 @@ function main(
5756
const parent = `projects/${project}/locations/${location}`;
5857

5958
// Values should match the input expected by your model.
60-
const trainingTaskInputsMessage = new definition.AutoMlImageClassificationInputs(
61-
{
59+
const trainingTaskInputsMessage =
60+
new definition.AutoMlImageClassificationInputs({
6261
multiLabel: true,
6362
modelType: ModelType.CLOUD,
6463
budgetMilliNodeHours: 8000,
6564
disableEarlyStopping: false,
66-
}
67-
);
65+
});
6866

6967
const trainingTaskInputs = trainingTaskInputsMessage.toValue();
7068

ai-platform/snippets/create-training-pipeline-image-object-detection.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,8 @@ async function main(
3636
// const location = 'YOUR_PROJECT_LOCATION';
3737

3838
const aiplatform = require('@google-cloud/aiplatform');
39-
const {
40-
definition,
41-
} = aiplatform.protos.google.cloud.aiplatform.v1.schema.trainingjob;
39+
const {definition} =
40+
aiplatform.protos.google.cloud.aiplatform.v1.schema.trainingjob;
4241
const ModelType = definition.AutoMlImageObjectDetectionInputs.ModelType;
4342

4443
// Imports the Google Cloud Pipeline Service Client library
@@ -56,13 +55,12 @@ async function main(
5655
// Configure the parent resource
5756
const parent = `projects/${project}/locations/${location}`;
5857

59-
const trainingTaskInputsObj = new definition.AutoMlImageObjectDetectionInputs(
60-
{
58+
const trainingTaskInputsObj =
59+
new definition.AutoMlImageObjectDetectionInputs({
6160
disableEarlyStopping: false,
6261
modelType: ModelType.CLOUD_HIGH_ACCURACY_1,
6362
budgetMilliNodeHours: 20000,
64-
}
65-
);
63+
});
6664

6765
const trainingTaskInputs = trainingTaskInputsObj.toValue();
6866
const modelToUpload = {displayName: modelDisplayName};

ai-platform/snippets/create-training-pipeline-tabular-classification.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,8 @@ async function main(
3737
// const project = 'YOUR_PROJECT_ID';
3838
// const location = 'YOUR_PROJECT_LOCATION';
3939
const aiplatform = require('@google-cloud/aiplatform');
40-
const {
41-
definition,
42-
} = aiplatform.protos.google.cloud.aiplatform.v1.schema.trainingjob;
40+
const {definition} =
41+
aiplatform.protos.google.cloud.aiplatform.v1.schema.trainingjob;
4342

4443
// Imports the Google Cloud Pipeline Service Client library
4544
const {PipelineServiceClient} = aiplatform.v1;

ai-platform/snippets/create-training-pipeline-tabular-regression.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,8 @@ async function main(
3737
// const project = 'YOUR_PROJECT_ID';
3838
// const location = 'YOUR_PROJECT_LOCATION';
3939
const aiplatform = require('@google-cloud/aiplatform');
40-
const {
41-
definition,
42-
} = aiplatform.protos.google.cloud.aiplatform.v1.schema.trainingjob;
40+
const {definition} =
41+
aiplatform.protos.google.cloud.aiplatform.v1.schema.trainingjob;
4342

4443
// Imports the Google Cloud Pipeline Service Client library
4544
const {PipelineServiceClient} = aiplatform.v1;

ai-platform/snippets/create-training-pipeline-text-classification.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,8 @@ async function main(
3535
// const project = 'YOUR_PROJECT_ID';
3636
// const location = 'YOUR_PROJECT_LOCATION';
3737
const aiplatform = require('@google-cloud/aiplatform');
38-
const {
39-
definition,
40-
} = aiplatform.protos.google.cloud.aiplatform.v1.schema.trainingjob;
38+
const {definition} =
39+
aiplatform.protos.google.cloud.aiplatform.v1.schema.trainingjob;
4140

4241
// Imports the Google Cloud Pipeline Service Client library
4342
const {PipelineServiceClient} = aiplatform.v1;

ai-platform/snippets/create-training-pipeline-text-entity-extraction.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,8 @@ async function main(
3535
// const project = 'YOUR_PROJECT_ID';
3636
// const location = 'YOUR_PROJECT_LOCATION';
3737
const aiplatform = require('@google-cloud/aiplatform');
38-
const {
39-
definition,
40-
} = aiplatform.protos.google.cloud.aiplatform.v1.schema.trainingjob;
38+
const {definition} =
39+
aiplatform.protos.google.cloud.aiplatform.v1.schema.trainingjob;
4140

4241
// Imports the Google Cloud Pipeline Service Client library
4342
const {PipelineServiceClient} = aiplatform.v1;

ai-platform/snippets/create-training-pipeline-text-sentiment-analysis.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,8 @@ async function main(
3535
// const project = 'YOUR_PROJECT_ID';
3636
// const location = 'YOUR_PROJECT_LOCATION';
3737
const aiplatform = require('@google-cloud/aiplatform');
38-
const {
39-
definition,
40-
} = aiplatform.protos.google.cloud.aiplatform.v1.schema.trainingjob;
38+
const {definition} =
39+
aiplatform.protos.google.cloud.aiplatform.v1.schema.trainingjob;
4140

4241
// Imports the Google Cloud Pipeline Service Client library
4342
const {PipelineServiceClient} = aiplatform.v1;

ai-platform/snippets/create-training-pipeline-video-classification.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,8 @@ async function main(
3535
// const project = 'YOUR_PROJECT_ID';
3636
// const location = 'YOUR_PROJECT_LOCATION';
3737
const aiplatform = require('@google-cloud/aiplatform');
38-
const {
39-
definition,
40-
} = aiplatform.protos.google.cloud.aiplatform.v1.schema.trainingjob;
38+
const {definition} =
39+
aiplatform.protos.google.cloud.aiplatform.v1.schema.trainingjob;
4140

4241
// Imports the Google Cloud Pipeline Service Client library
4342
const {PipelineServiceClient} = aiplatform.v1;

ai-platform/snippets/create-training-pipeline-video-object-tracking.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,8 @@ async function main(
3535
// const project = 'YOUR_PROJECT_ID';
3636
// const location = 'YOUR_PROJECT_LOCATION';
3737
const aiplatform = require('@google-cloud/aiplatform');
38-
const {
39-
definition,
40-
} = aiplatform.protos.google.cloud.aiplatform.v1.schema.trainingjob;
38+
const {definition} =
39+
aiplatform.protos.google.cloud.aiplatform.v1.schema.trainingjob;
4140
const ModelType = definition.AutoMlVideoObjectTrackingInputs.ModelType;
4241

4342
// Imports the Google Cloud Pipeline Service Client library
@@ -55,11 +54,10 @@ async function main(
5554
// Configure the parent resource
5655
const parent = `projects/${project}/locations/${location}`;
5756

58-
const trainingTaskInputsObj = new definition.AutoMlVideoObjectTrackingInputs(
59-
{
57+
const trainingTaskInputsObj =
58+
new definition.AutoMlVideoObjectTrackingInputs({
6059
modelType: ModelType.CLOUD,
61-
}
62-
);
60+
});
6361
const trainingTaskInputs = trainingTaskInputsObj.toValue();
6462

6563
const modelToUpload = {displayName: modelDisplayName};

ai-platform/snippets/predict-image-classification.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,8 @@ function main(filename, endpointId, project, location = 'us-central1') {
2828
// const project = 'YOUR_PROJECT_ID';
2929
// const location = 'YOUR_PROJECT_LOCATION';
3030
const aiplatform = require('@google-cloud/aiplatform');
31-
const {
32-
instance,
33-
params,
34-
prediction,
35-
} = aiplatform.protos.google.cloud.aiplatform.v1.schema.predict;
31+
const {instance, params, prediction} =
32+
aiplatform.protos.google.cloud.aiplatform.v1.schema.predict;
3633

3734
// Imports the Google Cloud Prediction Service Client library
3835
const {PredictionServiceClient} = aiplatform.v1;
@@ -77,9 +74,8 @@ function main(filename, endpointId, project, location = 'us-central1') {
7774
const predictions = response.predictions;
7875
console.log('\tPredictions :');
7976
for (const predictionValue of predictions) {
80-
const predictionResultObj = prediction.ClassificationPredictionResult.fromValue(
81-
predictionValue
82-
);
77+
const predictionResultObj =
78+
prediction.ClassificationPredictionResult.fromValue(predictionValue);
8379
for (const [i, label] of predictionResultObj.displayNames.entries()) {
8480
console.log(`\tDisplay name: ${label}`);
8581
console.log(`\tConfidences: ${predictionResultObj.confidences[i]}`);

0 commit comments

Comments
 (0)