Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -8,22 +8,16 @@ 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(pro,
|
12 |
response = model.generate_content([pro, image])
|
13 |
print(response.text)
|
14 |
-
|
15 |
-
return
|
16 |
|
17 |
-
# Interface Gradio
|
18 |
-
iface = gr.Interface(fn=generate_content, inputs=[gr.Textbox(), gr.Image(type='pil')], outputs="text")
|
19 |
-
|
20 |
-
# Lancez l'interface Gradio
|
21 |
-
iface.launch(share=True)
|
22 |
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
#
|
27 |
-
|
28 |
-
|
29 |
-
demo.queue().launch()
|
|
|
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 |
|
18 |
+
markdown = r"""
|
19 |
+
e
|
20 |
+
""".format(e)
|
21 |
+
# Interface Gradio
|
22 |
+
iface = gr.Interface(fn=generate_content, inputs=[gr.Textbox(),gr.Image(type='pil')], outputs= gr.Markdown(markdown, latex_delimiters=[{ "left": "$$", "right": "$$", "display": True }]))
|
23 |
+
iface.launch(share=True)
|
|