Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -253,6 +253,8 @@ Follow this example structure:
|
|
253 |
)
|
254 |
|
255 |
response = await model.generate_content_async(messages)
|
|
|
|
|
256 |
|
257 |
return json.loads(response.text)
|
258 |
|
@@ -282,7 +284,6 @@ Follow this example structure:
|
|
282 |
async def generate_podcast(self, input_text: str, language: str, speaker1: str, speaker2: str, api_key: str) -> str:
|
283 |
gr.Info("Generating podcast script...")
|
284 |
podcast_json = await self.generate_script(input_text, language, api_key)
|
285 |
-
print(f"Generated podcast script:\n{podcast_json}")
|
286 |
gr.Info("Generating podcast audio files...")
|
287 |
audio_files = await asyncio.gather(*[self.tts_generate(item['line'], item['speaker'], speaker1, speaker2) for item in podcast_json['podcast']])
|
288 |
combined_audio = await self.combine_audio_files(audio_files)
|
@@ -381,7 +382,7 @@ iface = gr.Interface(
|
|
381 |
"Vivienne - French (France)"
|
382 |
],
|
383 |
value="Ava - English (United States)"),
|
384 |
-
gr.Textbox(label="Gemini API Key (Optional)
|
385 |
],
|
386 |
outputs=[
|
387 |
gr.Audio(label="Generated Podcast Audio")
|
|
|
253 |
)
|
254 |
|
255 |
response = await model.generate_content_async(messages)
|
256 |
+
|
257 |
+
print(f"Generated podcast script:\n{response.text}")
|
258 |
|
259 |
return json.loads(response.text)
|
260 |
|
|
|
284 |
async def generate_podcast(self, input_text: str, language: str, speaker1: str, speaker2: str, api_key: str) -> str:
|
285 |
gr.Info("Generating podcast script...")
|
286 |
podcast_json = await self.generate_script(input_text, language, api_key)
|
|
|
287 |
gr.Info("Generating podcast audio files...")
|
288 |
audio_files = await asyncio.gather(*[self.tts_generate(item['line'], item['speaker'], speaker1, speaker2) for item in podcast_json['podcast']])
|
289 |
combined_audio = await self.combine_audio_files(audio_files)
|
|
|
382 |
"Vivienne - French (France)"
|
383 |
],
|
384 |
value="Ava - English (United States)"),
|
385 |
+
gr.Textbox(label="Your Gemini API Key (Optional) - In case you are getting rate limited"),
|
386 |
],
|
387 |
outputs=[
|
388 |
gr.Audio(label="Generated Podcast Audio")
|