Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -36,13 +36,20 @@ def classify_toxicity(audio_file, text_input, selected_model):
|
|
| 36 |
return toxicity_score, transcribed_text
|
| 37 |
# return f"Toxicity Score ({available_models[selected_model]}): {toxicity_score:.4f}"
|
| 38 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
iface = gr.Interface(
|
| 40 |
fn=classify_toxicity,
|
| 41 |
-
inputs=
|
| 42 |
-
gr.Audio(source="upload", type="filepath", label="Upload Audio File"),
|
| 43 |
-
gr.Textbox(type="text", label="Enter Text", placeholder="Enter text here..."),
|
| 44 |
-
gr.Radio(available_models, type="value", label="Select Model")
|
| 45 |
-
],
|
| 46 |
outputs="text",
|
| 47 |
live=True,
|
| 48 |
title="Toxicity Classifier with ASR",
|
|
|
|
| 36 |
return toxicity_score, transcribed_text
|
| 37 |
# return f"Toxicity Score ({available_models[selected_model]}): {toxicity_score:.4f}"
|
| 38 |
|
| 39 |
+
input_block = gr.Row([
|
| 40 |
+
gr.Column([
|
| 41 |
+
gr.Audio(source="upload", type="filepath", label="Upload Audio File"),
|
| 42 |
+
gr.Row([
|
| 43 |
+
gr.Textbox(type="text", label="Enter Text", placeholder="Enter text here..."),
|
| 44 |
+
gr.Button(label="Submit", type="submit")
|
| 45 |
+
])
|
| 46 |
+
]),
|
| 47 |
+
gr.Radio(available_models, type="value", label="Select Model")
|
| 48 |
+
])
|
| 49 |
+
|
| 50 |
iface = gr.Interface(
|
| 51 |
fn=classify_toxicity,
|
| 52 |
+
inputs=input_block,
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
outputs="text",
|
| 54 |
live=True,
|
| 55 |
title="Toxicity Classifier with ASR",
|