Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update app.py
Browse files
app.py
CHANGED
@@ -10,6 +10,13 @@ genai.configure(api_key=os.getenv("GEMINI_API_KEY"))
|
|
10 |
API_KEY = os.getenv('PLAY_API_KEY')
|
11 |
USER_ID = os.getenv('PLAY_USER_ID')
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
# Function to upload image to Gemini and get roasted text
|
14 |
def upload_to_gemini(path, mime_type="image/jpeg"):
|
15 |
file = genai.upload_file(path, mime_type=mime_type)
|
@@ -62,7 +69,7 @@ def text_to_speech(text):
|
|
62 |
return f"Error: {response.status_code} - {response.text}"
|
63 |
|
64 |
# Gradio Interface
|
65 |
-
with gr.Blocks(theme=
|
66 |
gr.Markdown("# Image to Text-to-Speech Roasting App")
|
67 |
gr.Markdown("Upload an image, and the AI will roast it and convert the roast to audio.")
|
68 |
|
|
|
10 |
API_KEY = os.getenv('PLAY_API_KEY')
|
11 |
USER_ID = os.getenv('PLAY_USER_ID')
|
12 |
|
13 |
+
# theme selection let's go with this before the branded color
|
14 |
+
#theme={"primary_hue": "#b4fd83"}
|
15 |
+
theme = gr.themes.Base(
|
16 |
+
primary_hue="emerald",
|
17 |
+
)
|
18 |
+
|
19 |
+
|
20 |
# Function to upload image to Gemini and get roasted text
|
21 |
def upload_to_gemini(path, mime_type="image/jpeg"):
|
22 |
file = genai.upload_file(path, mime_type=mime_type)
|
|
|
69 |
return f"Error: {response.status_code} - {response.text}"
|
70 |
|
71 |
# Gradio Interface
|
72 |
+
with gr.Blocks(theme = theme) as demo:
|
73 |
gr.Markdown("# Image to Text-to-Speech Roasting App")
|
74 |
gr.Markdown("Upload an image, and the AI will roast it and convert the roast to audio.")
|
75 |
|