Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -111,7 +111,8 @@ def classify_toxicity(audio_file, text_input, classify_anxiety, emo_class, expli
|
|
| 111 |
# classification_df = pd.DataFrame.from_dict(classification_output)
|
| 112 |
print("keys ", classification_output.keys())
|
| 113 |
|
| 114 |
-
formatted_classification_output = ""
|
|
|
|
| 115 |
|
| 116 |
# plot.update(x=classification_df["labels"], y=classification_df["scores"])
|
| 117 |
if toxicity_score > threshold:
|
|
@@ -120,7 +121,7 @@ def classify_toxicity(audio_file, text_input, classify_anxiety, emo_class, expli
|
|
| 120 |
else:
|
| 121 |
affirm = ""
|
| 122 |
|
| 123 |
-
return toxicity_score,
|
| 124 |
# return f"Toxicity Score ({available_models[selected_model]}): {toxicity_score:.4f}"
|
| 125 |
else:
|
| 126 |
threshold = slider_logic(slider)
|
|
|
|
| 111 |
# classification_df = pd.DataFrame.from_dict(classification_output)
|
| 112 |
print("keys ", classification_output.keys())
|
| 113 |
|
| 114 |
+
formatted_classification_output = "\n".join([f"{key}: {value}" for key, value in classification_output.items()])
|
| 115 |
+
|
| 116 |
|
| 117 |
# plot.update(x=classification_df["labels"], y=classification_df["scores"])
|
| 118 |
if toxicity_score > threshold:
|
|
|
|
| 121 |
else:
|
| 122 |
affirm = ""
|
| 123 |
|
| 124 |
+
return toxicity_score, formatted_classification_output, transcribed_text, affirm
|
| 125 |
# return f"Toxicity Score ({available_models[selected_model]}): {toxicity_score:.4f}"
|
| 126 |
else:
|
| 127 |
threshold = slider_logic(slider)
|