Skip to content

Commit aa4fcda

Browse files
committed
refactor: clean up imports and reformat batch prediction job call in embedding tests
1 parent 5294b5e commit aa4fcda

1 file changed

Lines changed: 7 additions & 10 deletions

File tree

generative_ai/embeddings/test_embeddings_examples.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,23 @@
1414
import os
1515

1616
import backoff
17-
18-
from google.api_core.exceptions import FailedPrecondition, ResourceExhausted
19-
20-
import google.auth
21-
22-
from google.cloud import aiplatform
23-
from google.cloud.aiplatform import initializer as aiplatform_init
24-
25-
2617
import batch_example
2718
import code_retrieval_example
2819
import document_retrieval_example
2920
import generate_embeddings_with_lower_dimension
21+
from google.api_core.exceptions import FailedPrecondition, ResourceExhausted
22+
import google.auth
23+
from google.cloud import aiplatform
24+
from google.cloud.aiplatform import initializer as aiplatform_init
3025
import model_tuning_example
3126
import multimodal_example
3227

3328

3429
@backoff.on_exception(backoff.expo, ResourceExhausted, max_time=10)
3530
def test_embed_text_batch() -> None:
36-
batch_prediction_job = batch_example.embed_text_batch("gs://python-docs-samples-tests/")
31+
batch_prediction_job = batch_example.embed_text_batch(
32+
"gs://python-docs-samples-tests/"
33+
)
3734
assert batch_prediction_job
3835

3936

0 commit comments

Comments
 (0)