Skip to content
Merged
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
9 changes: 2 additions & 7 deletions sdks/python/apache_beam/ml/rag/embeddings/vertex_ai_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

"""Tests for apache_beam.ml.rag.embeddings.vertex_ai."""

import os
import shutil
import struct
import tempfile
Expand Down Expand Up @@ -186,21 +185,17 @@ def test_image_embedding_pipeline(self):

def test_image_embedding_pipeline_from_path(self):
png_bytes = _create_png_bytes()
img_path = os.path.join(self.artifact_location, 'test_img.png')
with open(img_path, 'wb') as f:
f.write(png_bytes)

test_items = [
EmbeddableItem.from_image(
img_path, id="img1", metadata={"source": "test"}),
png_bytes, id="img1", metadata={"source": "test"}),
]

expected = [
EmbeddableItem(
id="img1",
embedding=Embedding(dense_embedding=[0.0] * 1408),
metadata={"source": "test"},
content=Content(image=img_path)),
content=Content(image=png_bytes)),
]

artifact_location = tempfile.mkdtemp(prefix='vertex_ai_img_path_')
Expand Down
Loading