Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Changing to rizz
Browse files
app.py
CHANGED
@@ -41,16 +41,16 @@ def generate_roast(image_path):
|
|
41 |
model = genai.GenerativeModel(
|
42 |
model_name="gemini-1.5-flash-002",
|
43 |
generation_config=generation_config,
|
44 |
-
system_instruction="You are a professional
|
45 |
)
|
46 |
|
47 |
chat_session = model.start_chat(
|
48 |
history=[{"role": "user", "parts": [uploaded_file]}]
|
49 |
)
|
50 |
-
response = chat_session.send_message("
|
51 |
return response.text
|
52 |
except Exception as e:
|
53 |
-
return f"Error generating
|
54 |
|
55 |
# Function to convert text to speech with Play.ht
|
56 |
def text_to_speech(text):
|
@@ -121,8 +121,8 @@ def process_roast(image_path):
|
|
121 |
|
122 |
# Gradio Interface
|
123 |
with gr.Blocks(theme=theme) as demo:
|
124 |
-
gr.Markdown("# Get
|
125 |
-
gr.Markdown("Upload an image, click '
|
126 |
|
127 |
with gr.Row():
|
128 |
image_input = gr.Image(type="filepath", label="Upload Image")
|
@@ -133,7 +133,7 @@ with gr.Blocks(theme=theme) as demo:
|
|
133 |
video_output = gr.Video(label="Roast Video")
|
134 |
|
135 |
# Single button to handle all actions
|
136 |
-
roast_button = gr.Button("
|
137 |
roast_button.click(process_roast, inputs=image_input, outputs=[output_text, audio_output, video_output])
|
138 |
|
139 |
gr.Examples(
|
|
|
41 |
model = genai.GenerativeModel(
|
42 |
model_name="gemini-1.5-flash-002",
|
43 |
generation_config=generation_config,
|
44 |
+
system_instruction="You are a professional fashionista and satirist. Rizz up the provided profile picture in less than 50 words.",
|
45 |
)
|
46 |
|
47 |
chat_session = model.start_chat(
|
48 |
history=[{"role": "user", "parts": [uploaded_file]}]
|
49 |
)
|
50 |
+
response = chat_session.send_message("Rizz this image!")
|
51 |
return response.text
|
52 |
except Exception as e:
|
53 |
+
return f"Error generating rizz: {e}"
|
54 |
|
55 |
# Function to convert text to speech with Play.ht
|
56 |
def text_to_speech(text):
|
|
|
121 |
|
122 |
# Gradio Interface
|
123 |
with gr.Blocks(theme=theme) as demo:
|
124 |
+
gr.Markdown("# Get Rizzed, Ready?")
|
125 |
+
gr.Markdown("Upload an image, click 'Rizz Image', and the AI will roast it")
|
126 |
|
127 |
with gr.Row():
|
128 |
image_input = gr.Image(type="filepath", label="Upload Image")
|
|
|
133 |
video_output = gr.Video(label="Roast Video")
|
134 |
|
135 |
# Single button to handle all actions
|
136 |
+
roast_button = gr.Button("Rizz Image")
|
137 |
roast_button.click(process_roast, inputs=image_input, outputs=[output_text, audio_output, video_output])
|
138 |
|
139 |
gr.Examples(
|