Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -18,6 +18,8 @@ import pydub
|
|
18 |
tts_model_str = "en_us_hifi_jets_cpu.addon"
|
19 |
|
20 |
for name in list_repo_files(repo_id="balacoon/tts"):
|
|
|
|
|
21 |
if name == tts_model_str:
|
22 |
if not os.path.isfile(os.path.join(os.getcwd(), name)):
|
23 |
hf_hub_download(
|
@@ -99,10 +101,14 @@ async def greet(product,description):
|
|
99 |
if response.choices[0].message.content != "not moderated":
|
100 |
a_list = ["Sorry, I can't proceed for generating marketing email. Your content needs to be moderated first. Thank you!"]
|
101 |
with locker:
|
|
|
|
|
|
|
102 |
tts = TTS(os.path.join(os.getcwd(), tts_model_str))
|
103 |
speakers = tts.get_speakers()
|
104 |
model_to_speakers = dict()
|
105 |
model_to_speakers[tts_model_str] = speakers
|
|
|
106 |
samples = tts.synthesize(a_list[0], speakers[-1])
|
107 |
yield (tts.get_sampling_rate(), samples)
|
108 |
else:
|
|
|
18 |
tts_model_str = "en_us_hifi_jets_cpu.addon"
|
19 |
|
20 |
for name in list_repo_files(repo_id="balacoon/tts"):
|
21 |
+
print(name)
|
22 |
+
print(os.path.join(os.getcwd(), name))
|
23 |
if name == tts_model_str:
|
24 |
if not os.path.isfile(os.path.join(os.getcwd(), name)):
|
25 |
hf_hub_download(
|
|
|
101 |
if response.choices[0].message.content != "not moderated":
|
102 |
a_list = ["Sorry, I can't proceed for generating marketing email. Your content needs to be moderated first. Thank you!"]
|
103 |
with locker:
|
104 |
+
print(os.system("ls"))
|
105 |
+
print(os.system("pwd"))
|
106 |
+
print(os.path.join(os.getcwd(), tts_model_str))
|
107 |
tts = TTS(os.path.join(os.getcwd(), tts_model_str))
|
108 |
speakers = tts.get_speakers()
|
109 |
model_to_speakers = dict()
|
110 |
model_to_speakers[tts_model_str] = speakers
|
111 |
+
print(speakers)
|
112 |
samples = tts.synthesize(a_list[0], speakers[-1])
|
113 |
yield (tts.get_sampling_rate(), samples)
|
114 |
else:
|