Skip to content

Commit

Permalink
chore(deps): bump pillow from 10.0.1 to 10.3.0 in /generative_ai (#11400
Browse files Browse the repository at this point in the history
)

* chore(deps): bump pillow from 10.0.1 to 10.3.0 in /generative_ai

Bumps [pillow](https://github.com/python-pillow/Pillow) from 10.0.1 to 10.3.0.
- [Release notes](https://github.com/python-pillow/Pillow/releases)
- [Changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst)
- [Commits](python-pillow/Pillow@10.0.1...10.3.0)

---
updated-dependencies:
- dependency-name: pillow
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
2 people authored and pull[bot] committed Apr 16, 2024
1 parent 807afed commit b02b9a7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion generative_ai/embedding.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@
def embed_text(
texts: List[str] = ["banana muffins? ", "banana bread? banana muffins?"],
task: str = "RETRIEVAL_DOCUMENT",
model_name: str = "textembedding-gecko@003"
model_name: str = "textembedding-gecko@003",
) -> List[List[float]]:
"""Embeds texts with a pre-trained, foundational model."""
model = TextEmbeddingModel.from_pretrained(model_name)
inputs = [TextEmbeddingInput(text, task) for text in texts]
embeddings = model.get_embeddings(inputs)
return [embedding.values for embedding in embeddings]


# [END aiplatform_sdk_embedding]


Expand Down
4 changes: 3 additions & 1 deletion generative_ai/embedding_preview.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,16 @@ def embed_text(
texts: List[str] = ["banana muffins? ", "banana bread? banana muffins?"],
task: str = "QUESTION_ANSWERING",
model_name: str = "text-embedding-preview-0409",
dimensionality: Optional[int] = 256
dimensionality: Optional[int] = 256,
) -> List[List[float]]:
"""Embeds texts with a pre-trained, foundational model."""
model = TextEmbeddingModel.from_pretrained(model_name)
inputs = [TextEmbeddingInput(text, task) for text in texts]
kwargs = dict(output_dimensionality=dimensionality) if dimensionality else {}
embeddings = model.get_embeddings(inputs, **kwargs)
return [embedding.values for embedding in embeddings]


# [END generativeaionvertexai_sdk_embedding]


Expand Down
2 changes: 1 addition & 1 deletion generative_ai/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pandas==1.3.5; python_version == '3.7'
pandas==2.0.1; python_version > '3.7'
pillow==9.5.0; python_version < '3.8'
pillow==10.0.1; python_version >= '3.8'
pillow==10.3.0; python_version >= '3.8'
google-cloud-aiplatform[pipelines]==1.46.0
google-auth==2.17.3
anthropic[vertex]==0.21.3

0 comments on commit b02b9a7

Please sign in to comment.