Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,8 +2,10 @@ import google.generativeai as genai
|
|
| 2 |
import gradio as gr
|
| 3 |
import numpy as np
|
| 4 |
import PIL.Image
|
|
|
|
| 5 |
|
| 6 |
-
|
|
|
|
| 7 |
|
| 8 |
def ImageChat(image, prompt):
|
| 9 |
|
|
@@ -26,7 +28,6 @@ app = gr.Interface(ImageChat,
|
|
| 26 |
inputs = [gr.Image(label = "Image"), gr.Text(label = "Prompt")],
|
| 27 |
outputs = gr.Text(label = "Response"),
|
| 28 |
title = "Image Chat",
|
| 29 |
-
theme = "Taithrah/Minimal"
|
| 30 |
-
examples = [["clown.png"],["desk.jpg"],["drums.jpg"]])
|
| 31 |
|
| 32 |
app.launch()
|
|
|
|
| 2 |
import gradio as gr
|
| 3 |
import numpy as np
|
| 4 |
import PIL.Image
|
| 5 |
+
import os
|
| 6 |
|
| 7 |
+
gemini_api_key = os.getenv("GEMINI_API_KEY")
|
| 8 |
+
genai.configure(api_key=gemini_api_key)
|
| 9 |
|
| 10 |
def ImageChat(image, prompt):
|
| 11 |
|
|
|
|
| 28 |
inputs = [gr.Image(label = "Image"), gr.Text(label = "Prompt")],
|
| 29 |
outputs = gr.Text(label = "Response"),
|
| 30 |
title = "Image Chat",
|
| 31 |
+
theme = "Taithrah/Minimal")
|
|
|
|
| 32 |
|
| 33 |
app.launch()
|