Spaces:
Running
on
T4
Running
on
T4
gabrielchua
commited on
Commit
•
d5e153f
1
Parent(s):
b9d657b
fix meloTTS
Browse files
app.py
CHANGED
@@ -21,30 +21,6 @@ from pydub import AudioSegment
|
|
21 |
from prompts import SYSTEM_PROMPT
|
22 |
from utils import generate_script, generate_podcast_audio, parse_url
|
23 |
|
24 |
-
LANGUAGE_MAPPING = {
|
25 |
-
"English": "en",
|
26 |
-
"Chinese": "zh",
|
27 |
-
"French": "fr",
|
28 |
-
"German": "de",
|
29 |
-
"Hindi": "hi",
|
30 |
-
"Italian": "it",
|
31 |
-
"Japanese": "ja",
|
32 |
-
"Korean": "ko",
|
33 |
-
"Polish": "pl",
|
34 |
-
"Portuguese": "pt",
|
35 |
-
"Russian": "ru",
|
36 |
-
"Spanish": "es",
|
37 |
-
"Turkish": "tr"
|
38 |
-
}
|
39 |
-
|
40 |
-
MELO_TTS_LANGUAGE_MAPPING = {
|
41 |
-
"English": "EN",
|
42 |
-
"Spanish": "ES",
|
43 |
-
"French": "FR",
|
44 |
-
"Chinese": "ZJ",
|
45 |
-
"Japanese": "JP",
|
46 |
-
"Korean": "KR",
|
47 |
-
}
|
48 |
|
49 |
class DialogueItem(BaseModel):
|
50 |
"""A single dialogue item."""
|
@@ -79,6 +55,33 @@ def generate_podcast(
|
|
79 |
use_advanced_audio: bool,
|
80 |
) -> Tuple[str, str]:
|
81 |
"""Generate the audio and transcript from the PDFs and/or URL."""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
text = ""
|
83 |
|
84 |
# Check if the selected language is supported by MeloTTS when not using advanced audio
|
|
|
21 |
from prompts import SYSTEM_PROMPT
|
22 |
from utils import generate_script, generate_podcast_audio, parse_url
|
23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
|
25 |
class DialogueItem(BaseModel):
|
26 |
"""A single dialogue item."""
|
|
|
55 |
use_advanced_audio: bool,
|
56 |
) -> Tuple[str, str]:
|
57 |
"""Generate the audio and transcript from the PDFs and/or URL."""
|
58 |
+
|
59 |
+
LANGUAGE_MAPPING = {
|
60 |
+
"English": "en",
|
61 |
+
"Chinese": "zh",
|
62 |
+
"French": "fr",
|
63 |
+
"German": "de",
|
64 |
+
"Hindi": "hi",
|
65 |
+
"Italian": "it",
|
66 |
+
"Japanese": "ja",
|
67 |
+
"Korean": "ko",
|
68 |
+
"Polish": "pl",
|
69 |
+
"Portuguese": "pt",
|
70 |
+
"Russian": "ru",
|
71 |
+
"Spanish": "es",
|
72 |
+
"Turkish": "tr"
|
73 |
+
}
|
74 |
+
|
75 |
+
MELO_TTS_LANGUAGE_MAPPING = {
|
76 |
+
"English": "EN",
|
77 |
+
"Spanish": "ES",
|
78 |
+
"French": "FR",
|
79 |
+
"Chinese": "ZJ",
|
80 |
+
"Japanese": "JP",
|
81 |
+
"Korean": "KR",
|
82 |
+
}
|
83 |
+
|
84 |
+
|
85 |
text = ""
|
86 |
|
87 |
# Check if the selected language is supported by MeloTTS when not using advanced audio
|