Skip to content

Fix PIL.Image imports. #447

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 9, 2024
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: 4 additions & 5 deletions samples/text_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import PIL.Image
from absl.testing import absltest

import google.generativeai as genai
Expand Down Expand Up @@ -40,7 +39,7 @@ def test_text_gen_text_only_prompt_streaming(self):

def test_text_gen_multimodal_one_image_prompt(self):
# [START text_gen_multimodal_one_image_prompt]
import PIL
import PIL.Image

model = genai.GenerativeModel("gemini-1.5-flash")
organ = PIL.Image.open(media / "organ.jpg")
Expand All @@ -50,7 +49,7 @@ def test_text_gen_multimodal_one_image_prompt(self):

def test_text_gen_multimodal_one_image_prompt_streaming(self):
# [START text_gen_multimodal_one_image_prompt_streaming]
import PIL
import PIL.Image

model = genai.GenerativeModel("gemini-1.5-flash")
organ = PIL.Image.open(media / "organ.jpg")
Expand All @@ -62,7 +61,7 @@ def test_text_gen_multimodal_one_image_prompt_streaming(self):

def test_text_gen_multimodal_multi_image_prompt(self):
# [START text_gen_multimodal_multi_image_prompt]
import PIL
import PIL.Image

model = genai.GenerativeModel("gemini-1.5-flash")
organ = PIL.Image.open(media / "organ.jpg")
Expand All @@ -75,7 +74,7 @@ def test_text_gen_multimodal_multi_image_prompt(self):

def test_text_gen_multimodal_multi_image_prompt_streaming(self):
# [START text_gen_multimodal_multi_image_prompt_streaming]
import PIL
import PIL.Image

model = genai.GenerativeModel("gemini-1.5-flash")
organ = PIL.Image.open(media / "organ.jpg")
Expand Down
Loading