Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 0 additions & 57 deletions generative_ai/embeddings/multimodal_image_example.py

This file was deleted.

64 changes: 0 additions & 64 deletions generative_ai/embeddings/multimodal_video_example.py

This file was deleted.

34 changes: 7 additions & 27 deletions generative_ai/embeddings/test_embeddings_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,23 @@
import os

import backoff

from google.api_core.exceptions import FailedPrecondition, ResourceExhausted

import google.auth

from google.cloud import aiplatform
from google.cloud.aiplatform import initializer as aiplatform_init


import batch_example
import code_retrieval_example
import document_retrieval_example
import generate_embeddings_with_lower_dimension
from google.api_core.exceptions import FailedPrecondition, ResourceExhausted
import google.auth
from google.cloud import aiplatform
from google.cloud.aiplatform import initializer as aiplatform_init
import model_tuning_example
import multimodal_example
import multimodal_image_example
import multimodal_video_example


@backoff.on_exception(backoff.expo, ResourceExhausted, max_time=10)
def test_embed_text_batch() -> None:
batch_prediction_job = batch_example.embed_text_batch("gs://python-docs-samples-tests/")
batch_prediction_job = batch_example.embed_text_batch(
"gs://python-docs-samples-tests/"
)
assert batch_prediction_job


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


@backoff.on_exception(backoff.expo, ResourceExhausted, max_time=10)
def test_multimodal_embedding_video() -> None:
embeddings = multimodal_video_example.get_video_embeddings()
Comment thread
Kef131 marked this conversation as resolved.
assert embeddings is not None
assert embeddings.video_embeddings is not None


@backoff.on_exception(backoff.expo, ResourceExhausted, max_time=10)
def test_multimodal_embedding_image() -> None:
embeddings = multimodal_image_example.get_image_text_embeddings()
assert embeddings is not None
assert embeddings.image_embedding is not None
assert embeddings.text_embedding is not None


@backoff.on_exception(backoff.expo, ResourceExhausted, max_time=10)
def test_generate_embeddings_with_lower_dimension() -> None:
embeddings = (
Expand Down
Loading