Skip to content

Commit 14b41b5

Browse files
yinghsienwucopybara-github
authored andcommitted
docs: Update README
PiperOrigin-RevId: 606818072
1 parent 6398ba2 commit 14b41b5

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

vertexai/generative_models/README.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,15 @@ print(model.generate_content("Why is sky blue?"))
3838
#### Using images and videos
3939
```python
4040
from vertexai.preview.generative_models import GenerativeModel, Image
41-
print(vision_model = GenerativeModel("gemini-pro-vision"))
41+
vision_model = GenerativeModel("gemini-pro-vision")
4242

4343
# Local image
4444
image = Image.load_from_file("image.jpg")
45-
print(vision_model.generate_content(image))
45+
print(vision_model.generate_content(["What is shown in this image?", image]))
4646

4747
# Image from Cloud Storage
4848
image_part = generative_models.Part.from_uri("gs://download.tensorflow.org/example_images/320px-Felis_catus-cat_on_snow.jpg", mime_type="image/jpeg")
49-
print(vision_model.generate_content(image_part))
50-
51-
# Text and image
52-
print(vision_model.generate_content(["What is shown in this image?", image]))
49+
print(vision_model.generate_content([image_part, "Describe this image?"]))
5350

5451
# Text and video
5552
video_part = Part.from_uri("gs://cloud-samples-data/video/animals.mp4", mime_type="video/mp4")

0 commit comments

Comments
 (0)