Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -110,7 +110,7 @@ def classify_toxicity(audio_file, classify_anxiety, emo_class, explitive_selecti
|
|
110 |
# formatted_classification_output = "\n".join([f"{key}: {value}" for key, value in classification_output.items()])
|
111 |
# label_score_pairs = [(label, score) for label, score in zip(classification_output['labels'], classification_output['scores'])]
|
112 |
label_score_dict = {label: score for label, score in zip(classification_output['labels'], classification_output['scores'])}
|
113 |
-
k = max(label_score_dict,
|
114 |
maxval = label_score_dict[k]
|
115 |
if maxval > tox_score:
|
116 |
if maxval > threshold:
|
|
|
110 |
# formatted_classification_output = "\n".join([f"{key}: {value}" for key, value in classification_output.items()])
|
111 |
# label_score_pairs = [(label, score) for label, score in zip(classification_output['labels'], classification_output['scores'])]
|
112 |
label_score_dict = {label: score for label, score in zip(classification_output['labels'], classification_output['scores'])}
|
113 |
+
k = max(label_score_dict, key=label_score_dict.get)
|
114 |
maxval = label_score_dict[k]
|
115 |
if maxval > tox_score:
|
116 |
if maxval > threshold:
|