Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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)
|