Update app.py
Browse files
app.py
CHANGED
@@ -227,8 +227,7 @@ def process_video(voice, url, text, progress=gr.Progress()):
|
|
227 |
|
228 |
def create_interface():
|
229 |
voices = get_voices()
|
230 |
-
|
231 |
-
with gr.Blocks() as app:
|
232 |
gr.Markdown("# Generator")
|
233 |
with gr.Row():
|
234 |
with gr.Column():
|
@@ -239,19 +238,16 @@ def create_interface():
|
|
239 |
with gr.Column():
|
240 |
video_output = gr.Video(label="Generated Video")
|
241 |
status_output = gr.Textbox(label="Status", interactive=False)
|
242 |
-
|
243 |
def on_generate(voice_name, url, text):
|
244 |
voice_id = next((v[1] for v in voices if v[0] == voice_name), None)
|
245 |
if not voice_id:
|
246 |
return None, "Invalid voice selected."
|
247 |
return process_video(voice_id, url, text)
|
248 |
-
|
249 |
generate_btn.click(
|
250 |
fn=on_generate,
|
251 |
inputs=[voice_dropdown, url_input, text_input],
|
252 |
outputs=[video_output, status_output]
|
253 |
)
|
254 |
-
|
255 |
return app
|
256 |
|
257 |
if __name__ == "__main__":
|
|
|
227 |
|
228 |
def create_interface():
|
229 |
voices = get_voices()
|
230 |
+
with gr.Blocks(css="#component-0 > :not(.prose) {display: none !important;}") as app:
|
|
|
231 |
gr.Markdown("# Generator")
|
232 |
with gr.Row():
|
233 |
with gr.Column():
|
|
|
238 |
with gr.Column():
|
239 |
video_output = gr.Video(label="Generated Video")
|
240 |
status_output = gr.Textbox(label="Status", interactive=False)
|
|
|
241 |
def on_generate(voice_name, url, text):
|
242 |
voice_id = next((v[1] for v in voices if v[0] == voice_name), None)
|
243 |
if not voice_id:
|
244 |
return None, "Invalid voice selected."
|
245 |
return process_video(voice_id, url, text)
|
|
|
246 |
generate_btn.click(
|
247 |
fn=on_generate,
|
248 |
inputs=[voice_dropdown, url_input, text_input],
|
249 |
outputs=[video_output, status_output]
|
250 |
)
|
|
|
251 |
return app
|
252 |
|
253 |
if __name__ == "__main__":
|