Update app.py
Browse files
app.py
CHANGED
|
@@ -167,6 +167,9 @@ def start_cleanup_thread(folder_path, interval_seconds=300, max_age_hours=1):
|
|
| 167 |
# Iniciar el hilo de limpieza al inicio del script
|
| 168 |
start_cleanup_thread(output_folder, interval_seconds=300, max_age_hours=1)
|
| 169 |
|
|
|
|
|
|
|
|
|
|
| 170 |
# Interfaz Gradio
|
| 171 |
with gr.Blocks() as demo:
|
| 172 |
gr.Markdown("# Text-to-Video Generator")
|
|
@@ -189,5 +192,5 @@ with gr.Blocks() as demo:
|
|
| 189 |
outputs=output_video
|
| 190 |
)
|
| 191 |
|
| 192 |
-
# Lanzar la aplicaci贸n
|
| 193 |
-
demo.launch(share=True)
|
|
|
|
| 167 |
# Iniciar el hilo de limpieza al inicio del script
|
| 168 |
start_cleanup_thread(output_folder, interval_seconds=300, max_age_hours=1)
|
| 169 |
|
| 170 |
+
# Leer el puerto asignado por Hugging Face o usar 7860 como valor predeterminado
|
| 171 |
+
port = int(os.getenv("PORT", 7860))
|
| 172 |
+
|
| 173 |
# Interfaz Gradio
|
| 174 |
with gr.Blocks() as demo:
|
| 175 |
gr.Markdown("# Text-to-Video Generator")
|
|
|
|
| 192 |
outputs=output_video
|
| 193 |
)
|
| 194 |
|
| 195 |
+
# Lanzar la aplicaci贸n usando el puerto asignado por Hugging Face
|
| 196 |
+
demo.launch(server_name="0.0.0.0", server_port=port, share=True)
|