Update app.py
Browse files
app.py
CHANGED
@@ -43,7 +43,7 @@ The model was trained on Thai audio recordings with the following sentences: \n
|
|
43 |
|
44 |
|
45 |
|
46 |
-
def predict(file_path
|
47 |
max_length = 100000
|
48 |
# file_path = filepath(file_upload)
|
49 |
# if (microphone is not None) and (file_upload is not None):
|
@@ -76,18 +76,14 @@ def predict(file_path,microphone_path):
|
|
76 |
predicted_class_id = torch.argmax(logits, dim=-1).item()
|
77 |
|
78 |
return predicted_class_id
|
79 |
-
|
80 |
gr.Interface(
|
81 |
fn=predict,
|
82 |
-
inputs=
|
83 |
-
# gr.inputs.Audio(source="upload", type="filepath", optional=True),
|
84 |
-
# gr.inputs.Audio(source="microphone", type="filepath", optional=True),
|
85 |
-
"file","file"
|
86 |
-
],
|
87 |
outputs="text",
|
88 |
title=title,
|
89 |
description=description,
|
90 |
).launch()
|
91 |
|
|
|
92 |
# iface = gr.Interface(fn=predict, inputs="file", outputs="text")
|
93 |
# iface.launch()
|
|
|
43 |
|
44 |
|
45 |
|
46 |
+
def predict(file_path):
|
47 |
max_length = 100000
|
48 |
# file_path = filepath(file_upload)
|
49 |
# if (microphone is not None) and (file_upload is not None):
|
|
|
76 |
predicted_class_id = torch.argmax(logits, dim=-1).item()
|
77 |
|
78 |
return predicted_class_id
|
|
|
79 |
gr.Interface(
|
80 |
fn=predict,
|
81 |
+
inputs=gr.inputs.Audio(type="file", label="Upload Audio File"),
|
|
|
|
|
|
|
|
|
82 |
outputs="text",
|
83 |
title=title,
|
84 |
description=description,
|
85 |
).launch()
|
86 |
|
87 |
+
|
88 |
# iface = gr.Interface(fn=predict, inputs="file", outputs="text")
|
89 |
# iface.launch()
|