Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -172,7 +172,7 @@ async def crear_video_profesional(prompt, custom_script, voz_index, musica=None)
|
|
| 172 |
def run_async_task(prompt, custom_script, voz_index, musica=None):
|
| 173 |
return asyncio.run(crear_video_profesional(prompt, custom_script, voz_index, musica))
|
| 174 |
|
| 175 |
-
# Interfaz profesional con
|
| 176 |
with gr.Blocks(theme=gr.themes.Soft(), title="Generador de Videos") as app:
|
| 177 |
gr.Markdown("# 馃幀 GENERADOR DE VIDEOS CON IA")
|
| 178 |
|
|
@@ -206,17 +206,19 @@ with gr.Blocks(theme=gr.themes.Soft(), title="Generador de Videos") as app:
|
|
| 206 |
label="Ejemplos"
|
| 207 |
)
|
| 208 |
|
| 209 |
-
# SOLUCI脫N
|
| 210 |
btn.click(
|
| 211 |
fn=run_async_task,
|
| 212 |
inputs=[prompt, custom_script, voz, musica],
|
| 213 |
outputs=output,
|
| 214 |
-
|
| 215 |
)
|
| 216 |
|
| 217 |
if __name__ == "__main__":
|
|
|
|
|
|
|
|
|
|
| 218 |
app.launch(
|
| 219 |
server_name="0.0.0.0",
|
| 220 |
-
server_port=7860
|
| 221 |
-
enable_queue=False # Asegurar que el queue est茅 deshabilitado globalmente
|
| 222 |
)
|
|
|
|
| 172 |
def run_async_task(prompt, custom_script, voz_index, musica=None):
|
| 173 |
return asyncio.run(crear_video_profesional(prompt, custom_script, voz_index, musica))
|
| 174 |
|
| 175 |
+
# Interfaz profesional con soluci贸n para el problema de colas
|
| 176 |
with gr.Blocks(theme=gr.themes.Soft(), title="Generador de Videos") as app:
|
| 177 |
gr.Markdown("# 馃幀 GENERADOR DE VIDEOS CON IA")
|
| 178 |
|
|
|
|
| 206 |
label="Ejemplos"
|
| 207 |
)
|
| 208 |
|
| 209 |
+
# SOLUCI脫N CORRECTA: Configuraci贸n de colas
|
| 210 |
btn.click(
|
| 211 |
fn=run_async_task,
|
| 212 |
inputs=[prompt, custom_script, voz, musica],
|
| 213 |
outputs=output,
|
| 214 |
+
concurrency_limit=1 # Limitar a 1 proceso concurrente
|
| 215 |
)
|
| 216 |
|
| 217 |
if __name__ == "__main__":
|
| 218 |
+
# Configuraci贸n correcta de colas
|
| 219 |
+
app.queue(concurrency_count=1, max_size=3) # Configuraci贸n segura para colas
|
| 220 |
+
|
| 221 |
app.launch(
|
| 222 |
server_name="0.0.0.0",
|
| 223 |
+
server_port=7860
|
|
|
|
| 224 |
)
|