Docfile commited on
Commit
e2b48fd
·
verified ·
1 Parent(s): e871a25

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -8,12 +8,12 @@ genai.configure(api_key=token)
8
  model = genai.GenerativeModel(model_name="gemini-pro-vision")
9
 
10
  # Fonction pour générer le contenu
11
- def generate_content(image):
12
- response = model.generate_content(["Write a short, engaging blog post based on this picture. It should include a description of the meal in the photo and talk about my journey meal prepping.", image])
13
  print(response.text)
14
  e = response.text
15
  return e
16
 
17
  # Interface Gradio
18
- iface = gr.Interface(fn=generate_content, inputs=gr.Image(type='pil'), outputs="text")
19
  iface.launch(share=True)
 
8
  model = genai.GenerativeModel(model_name="gemini-pro-vision")
9
 
10
  # Fonction pour générer le contenu
11
+ def generate_content(pro,image):
12
+ response = model.generate_content([pro, image])
13
  print(response.text)
14
  e = response.text
15
  return e
16
 
17
  # Interface Gradio
18
+ iface = gr.Interface(fn=generate_content, inputs=[gr.Textbox(),gr.Image(type='pil')], outputs="text")
19
  iface.launch(share=True)