Docfile commited on
Commit
4b51045
·
verified ·
1 Parent(s): 2d50214

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -1,8 +1,13 @@
1
  import gradio as gr
2
  import PIL.Image
 
3
 
 
 
 
 
4
  # Chargez l'image
5
-
6
  # Fonction pour générer le contenu
7
  def generate_content(image):
8
  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], stream=True)
 
1
  import gradio as gr
2
  import PIL.Image
3
+ import google.generativeai as genai
4
 
5
+ token = "AIzaSyDYhyRoOWBJWOb4bqY5wmFLrBo4HTwQDko"
6
+ genai.configure(
7
+ api_key=token
8
+ )
9
  # Chargez l'image
10
+ model = genai.GenerativeModel(model_name="gemini-pro-vision")
11
  # Fonction pour générer le contenu
12
  def generate_content(image):
13
  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], stream=True)