Spaces:
Build error
Build error
gorkemgoknar
commited on
Commit
·
64723a9
1
Parent(s):
b66e729
Update app.py
Browse files-disable text-text interface
app.py
CHANGED
@@ -270,7 +270,6 @@ css="""
|
|
270 |
#some selected ones are in for demo use
|
271 |
personality_choices = ["Gandalf", "Riddick", "Macleod", "Morpheus", "Neo","Spock","Vader","Indy", "Ig-11","Threepio","Tony Stark","Batman","Vizzini"]
|
272 |
title = "Movie Chatbot with Coqui YourTTS"
|
273 |
-
description = "Chat with your favorite movie characters, making characters voice like you. See Coqui Space for more TTS models https://huggingface.co/spaces/coqui/CoquiTTS"
|
274 |
article = "STT base model from mbarnig/lb-de-fr-en-pt-coqui-stt-models - 🐸 [Coqui.ai](https://https://coqui.ai/)"
|
275 |
|
276 |
#History not implemented in this demo, use metayazar.com/chatbot for a movie and character dropdown chat interface
|
@@ -280,6 +279,7 @@ examples=[['Gandalf','dragon.wav','Who are you sir?',{}]]
|
|
280 |
|
281 |
history = {"character": "None", "message_history" : [] }
|
282 |
|
|
|
283 |
|
284 |
interface_full = gr.Interface(fn=greet_stt_to_tts,
|
285 |
inputs=[gr.Dropdown(personality_choices),
|
@@ -289,14 +289,15 @@ interface_full = gr.Interface(fn=greet_stt_to_tts,
|
|
289 |
outputs=["html","state",gr.Audio(type="filepath")],
|
290 |
css=css, title="Chat with Your Voice", description=description,article=article ,
|
291 |
live=False)
|
292 |
-
|
|
|
293 |
interface_mic = gr.Interface(fn=greet,
|
294 |
inputs=[gr.Dropdown(personality_choices),
|
295 |
gr.Audio(source="microphone", type="filepath") ,
|
296 |
"text",
|
297 |
"state"],
|
298 |
outputs=["html","state",gr.Audio(type="filepath")],
|
299 |
-
css=css, title="
|
300 |
|
301 |
|
302 |
interface_text = gr.Interface(fn=greet_textonly,
|
@@ -306,6 +307,7 @@ interface_text = gr.Interface(fn=greet_textonly,
|
|
306 |
outputs=["html","state"],
|
307 |
css=css, title="Chat Text Only", description=description,article=article)
|
308 |
|
|
|
309 |
|
310 |
interface_file= gr.Interface(fn=greet,
|
311 |
inputs=[gr.Dropdown(personality_choices),
|
@@ -313,10 +315,10 @@ interface_file= gr.Interface(fn=greet,
|
|
313 |
"text",
|
314 |
"state"],
|
315 |
outputs=["html","state",gr.Audio(type="filepath")],
|
316 |
-
css=css, title="
|
317 |
|
318 |
|
319 |
|
320 |
|
321 |
-
appinterface = gr.TabbedInterface([interface_mic,interface_full,interface_file
|
322 |
appinterface.launch()
|
|
|
270 |
#some selected ones are in for demo use
|
271 |
personality_choices = ["Gandalf", "Riddick", "Macleod", "Morpheus", "Neo","Spock","Vader","Indy", "Ig-11","Threepio","Tony Stark","Batman","Vizzini"]
|
272 |
title = "Movie Chatbot with Coqui YourTTS"
|
|
|
273 |
article = "STT base model from mbarnig/lb-de-fr-en-pt-coqui-stt-models - 🐸 [Coqui.ai](https://https://coqui.ai/)"
|
274 |
|
275 |
#History not implemented in this demo, use metayazar.com/chatbot for a movie and character dropdown chat interface
|
|
|
279 |
|
280 |
history = {"character": "None", "message_history" : [] }
|
281 |
|
282 |
+
description = "Speak with your your voice, get chat output with your voice. If you want you can upload an audio file (with your favourite character) and get chat response with that voice.\n See Coqui Space for more TTS models https://huggingface.co/spaces/coqui/CoquiTTS"
|
283 |
|
284 |
interface_full = gr.Interface(fn=greet_stt_to_tts,
|
285 |
inputs=[gr.Dropdown(personality_choices),
|
|
|
289 |
outputs=["html","state",gr.Audio(type="filepath")],
|
290 |
css=css, title="Chat with Your Voice", description=description,article=article ,
|
291 |
live=False)
|
292 |
+
description = "Record your voice, get chat output with your voice."
|
293 |
+
|
294 |
interface_mic = gr.Interface(fn=greet,
|
295 |
inputs=[gr.Dropdown(personality_choices),
|
296 |
gr.Audio(source="microphone", type="filepath") ,
|
297 |
"text",
|
298 |
"state"],
|
299 |
outputs=["html","state",gr.Audio(type="filepath")],
|
300 |
+
css=css, title="TTS with Your Voice (YourTTS)", description=description,article=article )
|
301 |
|
302 |
|
303 |
interface_text = gr.Interface(fn=greet_textonly,
|
|
|
307 |
outputs=["html","state"],
|
308 |
css=css, title="Chat Text Only", description=description,article=article)
|
309 |
|
310 |
+
description = "Upload an audio file, get chat output as that voice."
|
311 |
|
312 |
interface_file= gr.Interface(fn=greet,
|
313 |
inputs=[gr.Dropdown(personality_choices),
|
|
|
315 |
"text",
|
316 |
"state"],
|
317 |
outputs=["html","state",gr.Audio(type="filepath")],
|
318 |
+
css=css, title="TTS with Your Voice (YourTTS) - upload file", description=description,article=article )
|
319 |
|
320 |
|
321 |
|
322 |
|
323 |
+
appinterface = gr.TabbedInterface([interface_mic,interface_full,interface_file], ["Chat with Mic Record","Chat Speech -> Speech", "Chat with Audio Upload" , "Chat Text only"])
|
324 |
appinterface.launch()
|