File tree Expand file tree Collapse file tree 2 files changed +2
-6
lines changed
Expand file tree Collapse file tree 2 files changed +2
-6
lines changed Original file line number Diff line number Diff line change 1616from google .cloud .aiplatform import BatchPredictionJob
1717
1818PROJECT_ID = os .getenv ("GOOGLE_CLOUD_PROJECT" )
19- OUTPUT_URI = os .getenv ("GCS_OUTPUT_URI" )
2019
2120
22- def embed_text_batch () -> BatchPredictionJob :
21+ def embed_text_batch (OUTPUT_URI : str ) -> BatchPredictionJob :
2322 """Example of how to generate embeddings from text using batch processing.
2423
2524 Read more: https://cloud.google.com/vertex-ai/generative-ai/docs/embeddings/batch-prediction-genai-embeddings
Original file line number Diff line number Diff line change 2222from google .cloud import aiplatform
2323from google .cloud .aiplatform import initializer as aiplatform_init
2424
25- import pytest
2625
2726import batch_example
2827import code_retrieval_example
3534
3635
3736@backoff .on_exception (backoff .expo , ResourceExhausted , max_time = 10 )
38- @pytest .fixture (scope = "session" )
3937def test_embed_text_batch () -> None :
40- os .environ ["GCS_OUTPUT_URI" ] = "gs://python-docs-samples-tests/"
41- batch_prediction_job = batch_example .embed_text_batch ()
38+ batch_prediction_job = batch_example .embed_text_batch ("gs://python-docs-samples-tests/" )
4239 assert batch_prediction_job
4340
4441
You can’t perform that action at this time.
0 commit comments