Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -133,6 +133,18 @@ def tts(text: str, model_name: str):
|
|
133 |
with tempfile.NamedTemporaryFile(suffix=".wav", delete=False) as fp:
|
134 |
synthesizer.save_wav(wavs, fp)
|
135 |
return fp.name
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
136 |
|
137 |
#Stories
|
138 |
def Story(text: input, model_name: str):
|
@@ -167,7 +179,7 @@ with demo:
|
|
167 |
b3.click(upsert, inputs=text, outputs=saved)
|
168 |
b4.click(selectall, inputs=text, outputs=savedAll)
|
169 |
b5.click(tts, inputs=[text,TTSchoice], outputs=audio)
|
170 |
-
b6.click(
|
171 |
|
172 |
# Lets Do It
|
173 |
demo.launch(share=True)
|
|
|
133 |
with tempfile.NamedTemporaryFile(suffix=".wav", delete=False) as fp:
|
134 |
synthesizer.save_wav(wavs, fp)
|
135 |
return fp.name
|
136 |
+
|
137 |
+
#TTStory
|
138 |
+
def ttstory(text: str, model_name: str):
|
139 |
+
print(text, model_name)
|
140 |
+
gen = GENERATORS.get(model_name, None)
|
141 |
+
if gen is None:
|
142 |
+
raise NameError("model not found")
|
143 |
+
#wavs = gen.tts(text)
|
144 |
+
#with tempfile.NamedTemporaryFile(suffix=".wav", delete=False) as fp:
|
145 |
+
# synthesizer.save_wav(wavs, fp)
|
146 |
+
# return fp.name
|
147 |
+
|
148 |
|
149 |
#Stories
|
150 |
def Story(text: input, model_name: str):
|
|
|
179 |
b3.click(upsert, inputs=text, outputs=saved)
|
180 |
b4.click(selectall, inputs=text, outputs=savedAll)
|
181 |
b5.click(tts, inputs=[text,TTSchoice], outputs=audio)
|
182 |
+
b6.click(ttstory, inputs=[text,Storychoice], outputs=text)
|
183 |
|
184 |
# Lets Do It
|
185 |
demo.launch(share=True)
|