Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -53,52 +53,28 @@ def generate_podcast(file, url, tone, length):
|
|
| 53 |
except Exception as e:
|
| 54 |
return None, f"An error occurred: {str(e)}"
|
| 55 |
|
| 56 |
-
# Instructions with Markdown for enhanced readability
|
| 57 |
instructions = """
|
| 58 |
-
#
|
| 59 |
-
Welcome to the Podcast Generator!
|
| 60 |
-
This tool creates **custom podcast episodes** using **AI-generated content**.
|
| 61 |
-
Upload a PDF or enter a URL to get started!
|
| 62 |
"""
|
| 63 |
|
| 64 |
-
# Define a custom premium theme using Gradio's theming capabilities
|
| 65 |
-
class PremiumTheme(gr.themes.Base):
|
| 66 |
-
def __init__(self):
|
| 67 |
-
super().__init__()
|
| 68 |
-
self.primary_hue = "#FF5722" # Orange color
|
| 69 |
-
self.neutral_hue = "#2196F3" # Blue color
|
| 70 |
-
self.background_fill_primary = "#121212" # Dark background
|
| 71 |
-
self.background_fill_secondary = "#1e1e1e" # Slightly lighter background
|
| 72 |
-
self.text_color_primary = "#f5f5f5" # Light text for readability
|
| 73 |
-
self.text_color_secondary = "#b0b0b0" # Muted secondary text
|
| 74 |
-
self.font = gr.themes.GoogleFont("Roboto") # Professional font
|
| 75 |
-
self.shadow_drop = "0 4px 6px rgba(0, 0, 0, 0.3)" # Subtle shadow
|
| 76 |
-
self.shadow_spread = "0 2px 4px rgba(0, 0, 0, 0.2)"
|
| 77 |
-
self.button_primary_background_fill = "#FF5722" # Orange buttons
|
| 78 |
-
self.button_primary_text_color = "#FFFFFF" # White button text
|
| 79 |
-
self.input_border_color = "#f5f5f5" # Inputs with light borders
|
| 80 |
-
|
| 81 |
-
# Use the custom theme for the interface
|
| 82 |
-
theme = PremiumTheme()
|
| 83 |
-
|
| 84 |
-
# Create the Gradio interface with enhanced visuals
|
| 85 |
iface = gr.Interface(
|
| 86 |
fn=generate_podcast,
|
| 87 |
inputs=[
|
| 88 |
gr.File(label="Upload PDF file (optional)", file_types=[".pdf"]),
|
| 89 |
-
gr.Textbox(label="OR Enter URL"
|
| 90 |
-
gr.Radio(["humorous", "casual", "formal"], label="Select
|
| 91 |
-
gr.Radio(["Short (1-2 min)", "Medium (3-5 min)"], label="Podcast
|
| 92 |
],
|
| 93 |
outputs=[
|
| 94 |
gr.Audio(label="Generated Podcast"),
|
| 95 |
gr.Markdown(label="Transcript")
|
| 96 |
],
|
| 97 |
-
title="🎙️
|
| 98 |
description=instructions,
|
| 99 |
-
|
| 100 |
-
|
| 101 |
)
|
| 102 |
|
| 103 |
if __name__ == "__main__":
|
| 104 |
-
iface.launch()
|
|
|
|
| 53 |
except Exception as e:
|
| 54 |
return None, f"An error occurred: {str(e)}"
|
| 55 |
|
|
|
|
| 56 |
instructions = """
|
| 57 |
+
# Podify Studio
|
| 58 |
+
Welcome to the Podcast Generator ! This tool creates custom podcast episodes using AI-generated content.
|
|
|
|
|
|
|
| 59 |
"""
|
| 60 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
iface = gr.Interface(
|
| 62 |
fn=generate_podcast,
|
| 63 |
inputs=[
|
| 64 |
gr.File(label="Upload PDF file (optional)", file_types=[".pdf"]),
|
| 65 |
+
gr.Textbox(label="OR Enter URL"),
|
| 66 |
+
gr.Radio(["humorous", "casual", "formal"], label="Select podcast tone", value="casual"),
|
| 67 |
+
gr.Radio(["Short (1-2 min)", "Medium (3-5 min)"], label="Podcast length", value="Medium (3-5 min)")
|
| 68 |
],
|
| 69 |
outputs=[
|
| 70 |
gr.Audio(label="Generated Podcast"),
|
| 71 |
gr.Markdown(label="Transcript")
|
| 72 |
],
|
| 73 |
+
title="🎙️ Amuthvani:AI Podcast !",
|
| 74 |
description=instructions,
|
| 75 |
+
allow_flagging="never",
|
| 76 |
+
theme=gr.themes.Soft()
|
| 77 |
)
|
| 78 |
|
| 79 |
if __name__ == "__main__":
|
| 80 |
+
iface.launch()
|