Skip to content

Commit 683bf45

Browse files
authored
refactor(generativeai/embeddings/multimodal): Remove deprecated embeddings multimodal files (#14523)
* refactor: remove legacy multimodal embedding image and video examples and their corresponding tests * test: remove imports for multimodal image and video embedding examples * refactor: clean up imports and reformat batch prediction job call in embedding tests
1 parent f02db46 commit 683bf45

3 files changed

Lines changed: 7 additions & 148 deletions

File tree

generative_ai/embeddings/multimodal_image_example.py

Lines changed: 0 additions & 57 deletions
This file was deleted.

generative_ai/embeddings/multimodal_video_example.py

Lines changed: 0 additions & 64 deletions
This file was deleted.

generative_ai/embeddings/test_embeddings_examples.py

Lines changed: 7 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -14,28 +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
32-
import multimodal_image_example
33-
import multimodal_video_example
3427

3528

3629
@backoff.on_exception(backoff.expo, ResourceExhausted, max_time=10)
3730
def test_embed_text_batch() -> None:
38-
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+
)
3934
assert batch_prediction_job
4035

4136

@@ -48,21 +43,6 @@ def test_multimodal_embedding_image_video_text() -> None:
4843
assert embeddings.text_embedding is not None
4944

5045

51-
@backoff.on_exception(backoff.expo, ResourceExhausted, max_time=10)
52-
def test_multimodal_embedding_video() -> None:
53-
embeddings = multimodal_video_example.get_video_embeddings()
54-
assert embeddings is not None
55-
assert embeddings.video_embeddings is not None
56-
57-
58-
@backoff.on_exception(backoff.expo, ResourceExhausted, max_time=10)
59-
def test_multimodal_embedding_image() -> None:
60-
embeddings = multimodal_image_example.get_image_text_embeddings()
61-
assert embeddings is not None
62-
assert embeddings.image_embedding is not None
63-
assert embeddings.text_embedding is not None
64-
65-
6646
@backoff.on_exception(backoff.expo, ResourceExhausted, max_time=10)
6747
def test_generate_embeddings_with_lower_dimension() -> None:
6848
embeddings = (

0 commit comments

Comments
 (0)