Update app.py
Browse files
app.py
CHANGED
@@ -16,20 +16,20 @@ examples = [
|
|
16 |
|
17 |
io1 = gr.Interface.load("huggingface/facebook/xm_transformer_s2ut_800m-es-en-st-asr-bt_h1_2022", api_key=st.secrets["api_key"])
|
18 |
|
19 |
-
def inference(
|
20 |
-
if mic is not None and file is None:
|
21 |
-
audio = mic
|
22 |
-
elif file is not None and mic is None:
|
23 |
-
audio = file
|
24 |
-
else:
|
25 |
-
return "ERROR: You must and may only select one method, it cannot be empty or select both methods at once."
|
26 |
out_audio = io1(audio)
|
27 |
return out_audio
|
28 |
|
29 |
|
30 |
gr.Interface(
|
31 |
inference,
|
32 |
-
[gr.inputs.Audio(source="
|
33 |
],
|
34 |
gr.outputs.Audio(label="Output"),
|
35 |
article=article,
|
|
|
16 |
|
17 |
io1 = gr.Interface.load("huggingface/facebook/xm_transformer_s2ut_800m-es-en-st-asr-bt_h1_2022", api_key=st.secrets["api_key"])
|
18 |
|
19 |
+
def inference(audio, model):
|
20 |
+
# if mic is not None and file is None:
|
21 |
+
# audio = mic
|
22 |
+
# elif file is not None and mic is None:
|
23 |
+
# audio = file
|
24 |
+
# else:
|
25 |
+
# return "ERROR: You must and may only select one method, it cannot be empty or select both methods at once."
|
26 |
out_audio = io1(audio)
|
27 |
return out_audio
|
28 |
|
29 |
|
30 |
gr.Interface(
|
31 |
inference,
|
32 |
+
[gr.inputs.Audio(source="upload", type="filepath", optional=True, label="Input"),gr.inputs.Dropdown(choices=["xm_transformer_s2ut_800m-es-en-st-asr-bt_h1_2022"], default="xm_transformer_s2ut_800m-es-en-st-asr-bt_h1_2022",type="value", label="model")
|
33 |
],
|
34 |
gr.outputs.Audio(label="Output"),
|
35 |
article=article,
|