Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -68,13 +68,13 @@ with gr.Blocks(theme=gr.themes.Base(primary_hue="teal", secondary_hue="amber").s
|
|
| 68 |
background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%) !important;
|
| 69 |
}
|
| 70 |
""") as app:
|
| 71 |
-
|
| 72 |
gr.HTML("<div style='text-align:center;overflow:hidden;padding:20px;'><h1 style='color:#14b8a6;text-shadow: 0 0 20px rgba(20, 184, 166, 0.4);'>π SynthScope π€</h1><p style='color:#94a3b8;'>Search, Visualize, and Listen to Information</p></div>")
|
| 73 |
|
| 74 |
# Output Section
|
| 75 |
with gr.Column(elem_classes="output-section"):
|
| 76 |
gr.HTML("<div class='section-title'>π Search Results</div>")
|
| 77 |
-
|
| 78 |
# Text and Image in a row
|
| 79 |
with gr.Row():
|
| 80 |
with gr.Column(scale=1):
|
|
@@ -89,9 +89,9 @@ with gr.Blocks(theme=gr.themes.Base(primary_hue="teal", secondary_hue="amber").s
|
|
| 89 |
with gr.Column():
|
| 90 |
gr.HTML("<h4 style='color:#14b8a6; margin-bottom:10px; text-shadow: 0 0 10px rgba(20, 184, 166, 0.3);'>π Audio Narration</h4>")
|
| 91 |
audio_output = gr.Audio(
|
| 92 |
-
label="",
|
| 93 |
-
type="filepath",
|
| 94 |
-
show_label=False,
|
| 95 |
elem_classes="audio-container",
|
| 96 |
interactive=False
|
| 97 |
)
|
|
@@ -99,37 +99,43 @@ with gr.Blocks(theme=gr.themes.Base(primary_hue="teal", secondary_hue="amber").s
|
|
| 99 |
# Input Section
|
| 100 |
with gr.Column(elem_classes="input-section"):
|
| 101 |
gr.HTML("<div class='section-title'>π§ Controls</div>")
|
| 102 |
-
|
| 103 |
with gr.Row():
|
| 104 |
with gr.Column(scale=2):
|
| 105 |
text_input = gr.Textbox(
|
| 106 |
-
label="π Search Query",
|
| 107 |
placeholder="Enter your search query here...",
|
| 108 |
lines=2
|
| 109 |
)
|
| 110 |
with gr.Column(scale=1):
|
| 111 |
-
|
| 112 |
label="π€Select Voice",
|
| 113 |
choices=["Kore", "Zephyr", "Orus", "Fenrir", "Charon", "Umbriel", "Schedar", "Iapetus", "Puck", "Gacrux"],
|
| 114 |
value="Kore"
|
| 115 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 116 |
with gr.Column(scale=1):
|
| 117 |
radio_input = gr.Radio(
|
| 118 |
label="π¨ Image Style",
|
| 119 |
-
choices=["Comic", "Cartoon", "
|
| 120 |
value="Comic"
|
| 121 |
)
|
| 122 |
|
| 123 |
with gr.Row():
|
| 124 |
with gr.Column(scale=1):
|
| 125 |
btn = gr.Button(
|
| 126 |
-
"π Run SynthScope",
|
| 127 |
-
variant="primary",
|
| 128 |
size="lg"
|
| 129 |
)
|
| 130 |
with gr.Column(scale=1):
|
| 131 |
clear_btn = gr.ClearButton(
|
| 132 |
-
[text_input, radio_input, text_output, image_output, audio_output],
|
| 133 |
value="ποΈ Clear All",
|
| 134 |
variant="secondary",
|
| 135 |
size="lg"
|
|
@@ -137,8 +143,8 @@ with gr.Blocks(theme=gr.themes.Base(primary_hue="teal", secondary_hue="amber").s
|
|
| 137 |
|
| 138 |
# Event handlers
|
| 139 |
btn.click(
|
| 140 |
-
fn=GoogleSearchImageGen,
|
| 141 |
-
inputs=[text_input, radio_input,
|
| 142 |
outputs=[text_output, image_output, audio_output],
|
| 143 |
show_progress=True
|
| 144 |
)
|
|
|
|
| 68 |
background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%) !important;
|
| 69 |
}
|
| 70 |
""") as app:
|
| 71 |
+
|
| 72 |
gr.HTML("<div style='text-align:center;overflow:hidden;padding:20px;'><h1 style='color:#14b8a6;text-shadow: 0 0 20px rgba(20, 184, 166, 0.4);'>π SynthScope π€</h1><p style='color:#94a3b8;'>Search, Visualize, and Listen to Information</p></div>")
|
| 73 |
|
| 74 |
# Output Section
|
| 75 |
with gr.Column(elem_classes="output-section"):
|
| 76 |
gr.HTML("<div class='section-title'>π Search Results</div>")
|
| 77 |
+
|
| 78 |
# Text and Image in a row
|
| 79 |
with gr.Row():
|
| 80 |
with gr.Column(scale=1):
|
|
|
|
| 89 |
with gr.Column():
|
| 90 |
gr.HTML("<h4 style='color:#14b8a6; margin-bottom:10px; text-shadow: 0 0 10px rgba(20, 184, 166, 0.3);'>π Audio Narration</h4>")
|
| 91 |
audio_output = gr.Audio(
|
| 92 |
+
label="",
|
| 93 |
+
type="filepath",
|
| 94 |
+
show_label=False,
|
| 95 |
elem_classes="audio-container",
|
| 96 |
interactive=False
|
| 97 |
)
|
|
|
|
| 99 |
# Input Section
|
| 100 |
with gr.Column(elem_classes="input-section"):
|
| 101 |
gr.HTML("<div class='section-title'>π§ Controls</div>")
|
| 102 |
+
|
| 103 |
with gr.Row():
|
| 104 |
with gr.Column(scale=2):
|
| 105 |
text_input = gr.Textbox(
|
| 106 |
+
label="π Search Query",
|
| 107 |
placeholder="Enter your search query here...",
|
| 108 |
lines=2
|
| 109 |
)
|
| 110 |
with gr.Column(scale=1):
|
| 111 |
+
voice_input = gr.Dropdown(
|
| 112 |
label="π€Select Voice",
|
| 113 |
choices=["Kore", "Zephyr", "Orus", "Fenrir", "Charon", "Umbriel", "Schedar", "Iapetus", "Puck", "Gacrux"],
|
| 114 |
value="Kore"
|
| 115 |
+
)
|
| 116 |
+
with gr.Column(scale=1):
|
| 117 |
+
language_input = gr.Dropdown(
|
| 118 |
+
label="π€Select Language",
|
| 119 |
+
choices=["English", "Spanish", "Thai", "German", "Italian", "Tamil", "Arabic", "French", "Romanian", "Turkish", "Dutch", "Polish", "Japanese", "Portuguese", "Russian"],
|
| 120 |
+
value="English"
|
| 121 |
+
)
|
| 122 |
with gr.Column(scale=1):
|
| 123 |
radio_input = gr.Radio(
|
| 124 |
label="π¨ Image Style",
|
| 125 |
+
choices=["Comic", "Cartoon", "Disney", "Anime", "Ghibli", "Victorian", "Movie", "Star Wars", "Marvel", "Van Gogh", "Picasso"],
|
| 126 |
value="Comic"
|
| 127 |
)
|
| 128 |
|
| 129 |
with gr.Row():
|
| 130 |
with gr.Column(scale=1):
|
| 131 |
btn = gr.Button(
|
| 132 |
+
"π Run SynthScope",
|
| 133 |
+
variant="primary",
|
| 134 |
size="lg"
|
| 135 |
)
|
| 136 |
with gr.Column(scale=1):
|
| 137 |
clear_btn = gr.ClearButton(
|
| 138 |
+
[text_input, radio_input, language_input, voice_input, text_output, image_output, audio_output],
|
| 139 |
value="ποΈ Clear All",
|
| 140 |
variant="secondary",
|
| 141 |
size="lg"
|
|
|
|
| 143 |
|
| 144 |
# Event handlers
|
| 145 |
btn.click(
|
| 146 |
+
fn=GoogleSearchImageGen,
|
| 147 |
+
inputs=[text_input, radio_input, voice_input, language_input],
|
| 148 |
outputs=[text_output, image_output, audio_output],
|
| 149 |
show_progress=True
|
| 150 |
)
|