Skip to content

Commit

Permalink
fix: dimension parameter not supported (#11316)
Browse files Browse the repository at this point in the history
  • Loading branch information
irataxy authored Mar 20, 2024
1 parent ef1cea2 commit 217d590
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions generative_ai/multimodal_embedding_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ def get_image_embeddings(
location: str,
image_path: str,
contextual_text: Optional[str] = None,
dimension: int = 1408,
) -> MultiModalEmbeddingResponse:
"""Example of how to generate multimodal embeddings from image and text.
Expand All @@ -37,8 +36,6 @@ def get_image_embeddings(
location: Google Cloud Region, used to initialize vertexai
image_path: Path to image (local or Google Cloud Storage) to generate embeddings for.
contextual_text: Text to generate embeddings for.
dimension: Dimension for the returned embeddings.
https://cloud.google.com/vertex-ai/docs/generative-ai/embeddings/get-multimodal-embeddings#low-dimension
"""

vertexai.init(project=project_id, location=location)
Expand All @@ -49,7 +46,6 @@ def get_image_embeddings(
embeddings = model.get_embeddings(
image=image,
contextual_text=contextual_text,
dimension=dimension,
)
print(f"Image Embedding: {embeddings.image_embedding}")
print(f"Text Embedding: {embeddings.text_embedding}")
Expand Down

0 comments on commit 217d590

Please sign in to comment.