google / generative-ai-docs

Documentation for Google's Gen AI site - including the Gemini API and Gemma
https://ai.google.dev
Apache License 2.0
1.67k stars 599 forks source link

InvalidArgument: 400 Image input modality is not enabled #513

Closed hovanhoa closed 1 month ago

hovanhoa commented 2 months ago

Description of the bug:

I ran this below code to make a prompt for an image

import google.generativeai as genai
import PIL.Image
import os

img = PIL.Image.open('<IMAGE_FILE>')

model = genai.GenerativeModel(model_name="<MY_TUNED_MODEL>")

response = model.generate_content([img])
print(response.text)

But It's return the exception:

google.api_core.exceptions.InvalidArgument: 400 Image input modality is not enabled for

I already researched for this exception but found nothing. can anyone help me?

Actual vs expected behavior:

No response

Any other information you'd like to share?

But It's worked if I try Gemini model (such as gemini-1.5-flash)

luhhdaveyjr commented 2 months ago

bug

gmKeshari commented 1 month ago

Hi @hovanhoa. Currently, model tuning is available for text and not for image & video.

hovanhoa commented 1 month ago

Hmm, thank you @gmKeshari