Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,9 +4,10 @@ from script import *
|
|
| 4 |
|
| 5 |
|
| 6 |
def interface(Language, Audio):
|
|
|
|
| 7 |
|
| 8 |
if Language == 'Hausa':
|
| 9 |
-
command = query(
|
| 10 |
state = activate_hausa(command)
|
| 11 |
return state
|
| 12 |
|
|
@@ -16,7 +17,7 @@ def interface(Language, Audio):
|
|
| 16 |
# return state
|
| 17 |
|
| 18 |
elif Language == 'Yoruba':
|
| 19 |
-
command = query(
|
| 20 |
state = activate_yoruba(command)
|
| 21 |
return state
|
| 22 |
|
|
@@ -26,7 +27,7 @@ def interface(Language, Audio):
|
|
| 26 |
|
| 27 |
demo = gr.Interface(
|
| 28 |
fn=interface,
|
| 29 |
-
inputs=[gr.Dropdown(['Hausa', 'English', 'Yoruba'], value = 'Hausa', label='Select Your Prefered Language'), gr.Audio(source ='microphone', type='
|
| 30 |
outputs="text",
|
| 31 |
live=True
|
| 32 |
)
|
|
|
|
| 4 |
|
| 5 |
|
| 6 |
def interface(Language, Audio):
|
| 7 |
+
sr, array = Audio
|
| 8 |
|
| 9 |
if Language == 'Hausa':
|
| 10 |
+
command = query(array, 'ha')
|
| 11 |
state = activate_hausa(command)
|
| 12 |
return state
|
| 13 |
|
|
|
|
| 17 |
# return state
|
| 18 |
|
| 19 |
elif Language == 'Yoruba':
|
| 20 |
+
command = query(array, 'yo')
|
| 21 |
state = activate_yoruba(command)
|
| 22 |
return state
|
| 23 |
|
|
|
|
| 27 |
|
| 28 |
demo = gr.Interface(
|
| 29 |
fn=interface,
|
| 30 |
+
inputs=[gr.Dropdown(['Hausa', 'English', 'Yoruba'], value = 'Hausa', label='Select Your Prefered Language'), gr.Audio(source ='microphone', type='numpy')],
|
| 31 |
outputs="text",
|
| 32 |
live=True
|
| 33 |
)
|