From b5a9c795a579606baf97d0624d322faad9fe1f57 Mon Sep 17 00:00:00 2001 From: henrylee Date: Tue, 29 Oct 2024 14:47:33 +0000 Subject: [PATCH 1/2] feat: from vertexai.batch_prediction import BatchPredictionJob --- generative_ai/batch_predict/gemini_batch_predict_gcs.py | 4 ++-- generative_ai/batch_predict/requirements.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/generative_ai/batch_predict/gemini_batch_predict_gcs.py b/generative_ai/batch_predict/gemini_batch_predict_gcs.py index 78a23376e18..d0d6ce36d04 100644 --- a/generative_ai/batch_predict/gemini_batch_predict_gcs.py +++ b/generative_ai/batch_predict/gemini_batch_predict_gcs.py @@ -13,7 +13,7 @@ # limitations under the License. import os -from vertexai.preview.batch_prediction import BatchPredictionJob +from vertexai.batch_prediction import BatchPredictionJob PROJECT_ID = os.getenv("GOOGLE_CLOUD_PROJECT") @@ -36,7 +36,7 @@ def batch_predict_gemini_createjob( import time import vertexai - from vertexai.preview.batch_prediction import BatchPredictionJob + from vertexai.batch_prediction import BatchPredictionJob # TODO(developer): Update and un-comment below lines # input_uri ="gs://[BUCKET]/[OUTPUT].jsonl" # Example diff --git a/generative_ai/batch_predict/requirements.txt b/generative_ai/batch_predict/requirements.txt index 5d8bc64d330..713b7eef992 100644 --- a/generative_ai/batch_predict/requirements.txt +++ b/generative_ai/batch_predict/requirements.txt @@ -3,7 +3,7 @@ pandas==2.0.3; python_version == '3.8' pandas==2.1.4; python_version > '3.8' pillow==10.3.0; python_version < '3.8' pillow==10.3.0; python_version >= '3.8' -google-cloud-aiplatform[all]==1.69.0 +google-cloud-aiplatform[all]==1.71.0 sentencepiece==0.2.0 google-auth==2.29.0 anthropic[vertex]==0.28.0 From 64ba481154aa25e87e63b977ce02bffa2f75a885 Mon Sep 17 00:00:00 2001 From: henrylee Date: Tue, 29 Oct 2024 23:14:22 +0000 Subject: [PATCH 2/2] feat: from vertexai.batch_prediction import BatchPredictionJob --- generative_ai/batch_predict/gemini_batch_predict_gcs.py | 1 - 1 file changed, 1 deletion(-) diff --git a/generative_ai/batch_predict/gemini_batch_predict_gcs.py b/generative_ai/batch_predict/gemini_batch_predict_gcs.py index d0d6ce36d04..aea46b74286 100644 --- a/generative_ai/batch_predict/gemini_batch_predict_gcs.py +++ b/generative_ai/batch_predict/gemini_batch_predict_gcs.py @@ -77,7 +77,6 @@ def batch_predict_gemini_createjob( # https://storage.googleapis.com/cloud-samples-data/batch/prompt_for_batch_gemini_predict.jsonl return batch_prediction_job - # [END generativeaionvertexai_batch_predict_gemini_createjob]