Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -23,6 +23,14 @@ import whisper
|
|
| 23 |
# tts_model = VitsModel.from_pretrained("facebook/mms-tts-pol")
|
| 24 |
# tts_model.to("cuda")
|
| 25 |
# print("TTS Loaded!")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
def load_whisper():
|
| 28 |
return whisper.load_model("medium", device = 'cpu')
|
|
@@ -168,17 +176,18 @@ def regenerate(_chatbot, _task_history):
|
|
| 168 |
|
| 169 |
|
| 170 |
with gr.Blocks() as chat_demo:
|
|
|
|
| 171 |
chatbot = gr.Chatbot(label='Llama Voice Chatbot', elem_classes="control-height")
|
| 172 |
query = gr.Textbox(lines=2, label='Input')
|
| 173 |
task_history = gr.State([])
|
| 174 |
audio_output = gr.Audio('temp_file.wav', label="Generated Audio (wav)", type='filepath', autoplay=False)
|
| 175 |
|
| 176 |
with gr.Row():
|
| 177 |
-
submit_btn = gr.Button("🚀
|
| 178 |
|
| 179 |
with gr.Row():
|
| 180 |
audio_upload = gr.Audio(source="microphone", type="filepath", show_label=False)
|
| 181 |
-
submit_audio_btn = gr.Button("🎙️
|
| 182 |
|
| 183 |
submit_btn.click(predict, [query, chatbot, task_history], [chatbot], show_progress=True)
|
| 184 |
submit_audio_btn.click(predict, [audio_upload, chatbot, task_history], [chatbot], show_progress=True).then(update_audio, chatbot, audio_output)
|
|
|
|
| 23 |
# tts_model = VitsModel.from_pretrained("facebook/mms-tts-pol")
|
| 24 |
# tts_model.to("cuda")
|
| 25 |
# print("TTS Loaded!")
|
| 26 |
+
DESCRIPTION = """\
|
| 27 |
+
# Ai Trek - Generative AI usage
|
| 28 |
+
This Space demonstrates LAIONBOT functionalities,
|
| 29 |
+
🔎 Large Language Models is a model notable for its ability to achieve general-purpose language generation and understanding.
|
| 30 |
+
🔨 On this demo, we can play with it not only by using text, but also asking questions and getting answers by Text to speech model.
|
| 31 |
+
"""
|
| 32 |
+
|
| 33 |
+
|
| 34 |
|
| 35 |
def load_whisper():
|
| 36 |
return whisper.load_model("medium", device = 'cpu')
|
|
|
|
| 176 |
|
| 177 |
|
| 178 |
with gr.Blocks() as chat_demo:
|
| 179 |
+
gr.Markdown(DESCRIPTION)
|
| 180 |
chatbot = gr.Chatbot(label='Llama Voice Chatbot', elem_classes="control-height")
|
| 181 |
query = gr.Textbox(lines=2, label='Input')
|
| 182 |
task_history = gr.State([])
|
| 183 |
audio_output = gr.Audio('temp_file.wav', label="Generated Audio (wav)", type='filepath', autoplay=False)
|
| 184 |
|
| 185 |
with gr.Row():
|
| 186 |
+
submit_btn = gr.Button("🚀 Send an input file to LLM")
|
| 187 |
|
| 188 |
with gr.Row():
|
| 189 |
audio_upload = gr.Audio(source="microphone", type="filepath", show_label=False)
|
| 190 |
+
submit_audio_btn = gr.Button("🎙️ Send an audio")
|
| 191 |
|
| 192 |
submit_btn.click(predict, [query, chatbot, task_history], [chatbot], show_progress=True)
|
| 193 |
submit_audio_btn.click(predict, [audio_upload, chatbot, task_history], [chatbot], show_progress=True).then(update_audio, chatbot, audio_output)
|