Spaces:
PlayHT
/
Running on CPU Upgrade

legofan94 commited on
Commit
b7ee106
·
verified ·
1 Parent(s): 3d2d856

Changing to rizz

Browse files
Files changed (1) hide show
  1. app.py +6 -6
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 satirist and fashion expert. Roast 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("Roast this image!")
51
  return response.text
52
  except Exception as e:
53
- return f"Error generating roast: {e}"
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 Roasted, Ready?")
125
- gr.Markdown("Upload an image, click 'Roast Image', and the AI will roast it")
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("Roast Image")
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(