Skip to content

Commit 725b465

Browse files
author
Guiners
committed
sample update
1 parent 177ff9a commit 725b465

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

genai/batch-prediction/batchpredict-embeddings-with-gcs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ async function runBatchPredictionJob(
5959
'JOB_STATE_PAUSED',
6060
]);
6161

62-
while (completedStates.has(job.state)) {
62+
while (!completedStates.has(job.state)) {
6363
await new Promise(resolve => setTimeout(resolve, 30000));
6464
job = await client.batches.get({name: job.name});
6565
console.log(`Job state: ${job.state}`);

genai/batch-prediction/batchpredict-with-bq.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ const {GoogleGenAI} = require('@google/genai');
1919

2020
const GOOGLE_CLOUD_PROJECT = process.env.GOOGLE_CLOUD_PROJECT;
2121
const GOOGLE_CLOUD_LOCATION = process.env.GOOGLE_CLOUD_LOCATION || 'global';
22-
const OUTPUT_URI = 'bq://your-project.your_dataset.your_table';
22+
// const OUTPUT_URI = 'bq://your-project.your_dataset.your_table';
23+
const OUTPUT_URI = 'bq://cloud-ai-devrel-softserve.gen_ai_batch_prediction.tes'
2324

2425
async function runBatchPredictionJob(
2526
outputUri = OUTPUT_URI,
@@ -60,7 +61,7 @@ async function runBatchPredictionJob(
6061
'JOB_STATE_PAUSED',
6162
]);
6263

63-
while (completedStates.has(job.state)) {
64+
while (!completedStates.has(job.state)) {
6465
await new Promise(resolve => setTimeout(resolve, 30000));
6566
job = await client.batches.get({name: job.name});
6667
console.log(`Job state: ${job.state}`);

genai/batch-prediction/batchpredict-with-gcs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ async function runBatchPredictionJob(
6161
'JOB_STATE_PAUSED',
6262
]);
6363

64-
while (completedStates.has(job.state)) {
64+
while (!completedStates.has(job.state)) {
6565
await new Promise(resolve => setTimeout(resolve, 30000));
6666
job = await client.batches.get({name: job.name});
6767
console.log(`Job state: ${job.state}`);

0 commit comments

Comments
 (0)