Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -892,6 +892,19 @@ def crear_video(prompt_type, input_text, selected_voice, musica_file=None):
|
|
| 892 |
total_time = (datetime.now() - start_time).total_seconds()
|
| 893 |
logger.info(f"PROCESO DE VIDEO FINALIZADO | Output: {output_path} | Tiempo total: {total_time:.2f}s")
|
| 894 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 895 |
return output_path
|
| 896 |
|
| 897 |
except ValueError as ve:
|
|
|
|
| 892 |
total_time = (datetime.now() - start_time).total_seconds()
|
| 893 |
logger.info(f"PROCESO DE VIDEO FINALIZADO | Output: {output_path} | Tiempo total: {total_time:.2f}s")
|
| 894 |
|
| 895 |
+
# --- SOLUCIÓN: Copiar video a directorio accesible por Gradio ---
|
| 896 |
+
final_output_filename = "final_video.mp4"
|
| 897 |
+
final_output_path = os.path.join(os.getcwd(), final_output_filename)
|
| 898 |
+
|
| 899 |
+
if os.path.exists(final_output_path):
|
| 900 |
+
os.remove(final_output_path) # Eliminar anterior si existe
|
| 901 |
+
|
| 902 |
+
shutil.copy2(output_path, final_output_path)
|
| 903 |
+
logger.info(f"Video copiado a ruta accesible para Gradio: {final_output_path}")
|
| 904 |
+
output_path = final_output_path # Sobrescribir la ruta a retornar
|
| 905 |
+
# --- FIN SOLUCIÓN ---
|
| 906 |
+
|
| 907 |
+
|
| 908 |
return output_path
|
| 909 |
|
| 910 |
except ValueError as ve:
|