Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -26,7 +26,7 @@ def guessanAge(model, image):
|
|
| 26 |
return description
|
| 27 |
|
| 28 |
@spaces.GPU(duration=120)
|
| 29 |
-
def text2speech(text, sample):
|
| 30 |
os.environ["COQUI_TOS_AGREED"] = "1"
|
| 31 |
if len(text) > 0:
|
| 32 |
tts = TTS("tts_models/multilingual/multi-dataset/xtts_v2")
|
|
@@ -72,15 +72,22 @@ tab2 = gr.Interface(
|
|
| 72 |
)
|
| 73 |
|
| 74 |
|
| 75 |
-
with gr.Blocks() as tab3:
|
| 76 |
-
gr.Markdown("type the text to speak:")
|
| 77 |
-
textbox = gr.Textbox(value="good morning pineapple! looking very good very nice!")
|
| 78 |
-
gr.Markdown("record your voice sample:")
|
| 79 |
-
micinput = gr.Audio(sources=['microphone'], type="filepath", format="wav", value="sampleaudio/abraham.wav")
|
| 80 |
|
| 81 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 82 |
fn=text2speech,
|
| 83 |
-
inputs=[textbox, micinput],
|
| 84 |
outputs=["audio"],
|
| 85 |
)
|
| 86 |
|
|
|
|
| 26 |
return description
|
| 27 |
|
| 28 |
@spaces.GPU(duration=120)
|
| 29 |
+
def text2speech(text, None, sample):
|
| 30 |
os.environ["COQUI_TOS_AGREED"] = "1"
|
| 31 |
if len(text) > 0:
|
| 32 |
tts = TTS("tts_models/multilingual/multi-dataset/xtts_v2")
|
|
|
|
| 72 |
)
|
| 73 |
|
| 74 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
|
| 76 |
+
|
| 77 |
+
textbox = gr.Textbox(value="good morning pineapple! looking very good very nice!")
|
| 78 |
+
sampletext = gr.HTML("""
|
| 79 |
+
<span>If you do not sample your voice my voice will be used as input<span><
|
| 80 |
+
<audio controls autoplay>
|
| 81 |
+
<source src="sampleaudio/abraham.wav" type="audio/wav">
|
| 82 |
+
Your browser does not support the audio element.
|
| 83 |
+
</audio>
|
| 84 |
+
|
| 85 |
+
""")
|
| 86 |
+
micinput = gr.Audio(sources=['microphone'], type="filepath", format="wav", value="sampleaudio/abraham.wav")
|
| 87 |
+
|
| 88 |
+
tab3 = gr.Interface(
|
| 89 |
fn=text2speech,
|
| 90 |
+
inputs=[textbox, sampletext, micinput],
|
| 91 |
outputs=["audio"],
|
| 92 |
)
|
| 93 |
|