Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -6,16 +6,6 @@ from TTS.api import TTS
|
|
6 |
import torch
|
7 |
import assemblyai as aai
|
8 |
|
9 |
-
# Handle interactive prompts programmatically
|
10 |
-
import builtins
|
11 |
-
|
12 |
-
def mock_input(prompt):
|
13 |
-
if "license" in prompt.lower():
|
14 |
-
return "y" # Automatically agree to terms
|
15 |
-
return ""
|
16 |
-
|
17 |
-
builtins.input = mock_input
|
18 |
-
|
19 |
# Download necessary models if not already present
|
20 |
model_files = {
|
21 |
"wav2lip.pth": "https://github.com/justinjohn0306/Wav2Lip/releases/download/models/wav2lip.pth",
|
@@ -25,10 +15,10 @@ model_files = {
|
|
25 |
"s3fd.pth": "https://www.adrianbulat.com/downloads/python-fan/s3fd-619a316812.pth"
|
26 |
}
|
27 |
|
|
|
28 |
# Initialize TTS model
|
29 |
tts = TTS("tts_models/multilingual/multi-dataset/xtts_v2", gpu=True)
|
30 |
|
31 |
-
|
32 |
for filename, url in model_files.items():
|
33 |
file_path = os.path.join("checkpoints" if "pth" in filename else "face_detection", filename)
|
34 |
if not os.path.exists(file_path):
|
|
|
6 |
import torch
|
7 |
import assemblyai as aai
|
8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
# Download necessary models if not already present
|
10 |
model_files = {
|
11 |
"wav2lip.pth": "https://github.com/justinjohn0306/Wav2Lip/releases/download/models/wav2lip.pth",
|
|
|
15 |
"s3fd.pth": "https://www.adrianbulat.com/downloads/python-fan/s3fd-619a316812.pth"
|
16 |
}
|
17 |
|
18 |
+
|
19 |
# Initialize TTS model
|
20 |
tts = TTS("tts_models/multilingual/multi-dataset/xtts_v2", gpu=True)
|
21 |
|
|
|
22 |
for filename, url in model_files.items():
|
23 |
file_path = os.path.join("checkpoints" if "pth" in filename else "face_detection", filename)
|
24 |
if not os.path.exists(file_path):
|