Spaces:
No application file
No application file
Commit History
14 days ago
-
app.py
Verified signatureimport os os.environ["COQUI_TOS_AGREED"] = "1" import gradio as gr import uuid, subprocess from pathlib import Path import torch from TTS.api import TTS if not Path("/tmp/wav2lip").exists(): subprocess.run(["git", "clone", "https://github.com/Rudrabha/Wav2Lip.git", "/tmp/wav2lip"]) CKPT = "/tmp/wav2lip/checkpoints/wav2lip_gan.pth" if not Path(CKPT).exists(): Path("/tmp/wav2lip/checkpoints").mkdir(parents=True, exist_ok=True) subprocess.run(["wget", "-q", "-O", CKPT, "https://huggingface.co/spaces/wav2lip/wav2lip/resolve/main/checkpoints/wav2lip_gan.pth"]) print("Chargement de l'IA...") device = "cuda" if torch.cuda.is_available() else "cpu" tts = TTS("tts_models/multilingual/multi-dataset/xtts_v2").to(device) print("IA prête.") def generer_video(image_path, texte): if not image_path or not texte: return None job = Path("/tmp") / str(uuid.uuid4()) job.mkdir(parents=True, exist_ok=True) video_path = job / "input.mp4" subprocess.r…2c68133 -
initial commit
Verified signature24855f5