Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import PIL.Image
|
3 |
+
|
4 |
+
# Chargez l'image
|
5 |
+
img = PIL.Image.open('image.jpg')
|
6 |
+
|
7 |
+
# Fonction pour générer le contenu
|
8 |
+
def generate_content(image):
|
9 |
+
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)
|
10 |
+
print(response.text)
|
11 |
+
return response.resolve()
|
12 |
+
|
13 |
+
# Interface Gradio
|
14 |
+
iface = gr.Interface(fn=generate_content, inputs=gr.Image(type='pil'), outputs="text")
|
15 |
+
iface.launch()
|