Update app.py
Browse files
app.py
CHANGED
@@ -187,13 +187,14 @@ def bot_response(message, history):
|
|
187 |
|
188 |
return llm_tokenizer.decode(out, skip_special_tokens=True)
|
189 |
|
190 |
-
|
191 |
def voice_player(history):
|
192 |
"""
|
193 |
Plays the generated response using the VITS-ljs model.
|
194 |
Returns the audio player with the generated response.
|
195 |
"""
|
196 |
_, text = history[-1]
|
|
|
197 |
voice = pipe(text)
|
198 |
voice = gr.Audio(value = (
|
199 |
voice["sampling_rate"],
|
@@ -222,7 +223,7 @@ with gr.Blocks(
|
|
222 |
label='MyAlexa'
|
223 |
)
|
224 |
with gr.Row():
|
225 |
-
|
226 |
with gr.Column():
|
227 |
gr.HTML(
|
228 |
"<p><b>Step 1:</b> Upload an audio file or record with your microphone.</p>"
|
|
|
187 |
|
188 |
return llm_tokenizer.decode(out, skip_special_tokens=True)
|
189 |
|
190 |
+
@spaces.GPU()
|
191 |
def voice_player(history):
|
192 |
"""
|
193 |
Plays the generated response using the VITS-ljs model.
|
194 |
Returns the audio player with the generated response.
|
195 |
"""
|
196 |
_, text = history[-1]
|
197 |
+
text = text.replace("*", "")
|
198 |
voice = pipe(text)
|
199 |
voice = gr.Audio(value = (
|
200 |
voice["sampling_rate"],
|
|
|
223 |
label='MyAlexa'
|
224 |
)
|
225 |
with gr.Row():
|
226 |
+
|
227 |
with gr.Column():
|
228 |
gr.HTML(
|
229 |
"<p><b>Step 1:</b> Upload an audio file or record with your microphone.</p>"
|