Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -87,8 +87,24 @@ audio_paths = [
|
|
| 87 |
"/users/ylabrak/Alexa_NLU/Pipeline/wavs/TTS_1/tell-me-the-artist-of-this-song.wav",
|
| 88 |
]
|
| 89 |
|
| 90 |
-
def
|
| 91 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
|
| 93 |
-
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
| 94 |
iface.launch()
|
|
|
|
| 87 |
"/users/ylabrak/Alexa_NLU/Pipeline/wavs/TTS_1/tell-me-the-artist-of-this-song.wav",
|
| 88 |
]
|
| 89 |
|
| 90 |
+
def predict(wav_file):
|
| 91 |
+
res = process(wav_file)
|
| 92 |
+
return res["text"]
|
| 93 |
+
|
| 94 |
+
# iface = gr.Interface(fn=predict, inputs="text", outputs="text")
|
| 95 |
+
|
| 96 |
+
iface = gr.Interface(
|
| 97 |
+
predict,
|
| 98 |
+
title='Alexa NLU Clone',
|
| 99 |
+
description='Upload your wav file to test the model',
|
| 100 |
+
inputs=[
|
| 101 |
+
gr.inputs.Audio(label='wav file', source='microphone', type='filepath')
|
| 102 |
+
],
|
| 103 |
+
outputs=[
|
| 104 |
+
gr.outputs.Textbox(label='decoding result'),
|
| 105 |
+
],
|
| 106 |
+
examples=examples,
|
| 107 |
+
article='Made with ❤️ by Yanis Labrak thanks to 🤗',
|
| 108 |
+
)
|
| 109 |
|
|
|
|
| 110 |
iface.launch()
|