Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -112,7 +112,7 @@ def classify_toxicity(audio_file, classify_anxiety, emo_class, explitive_selecti
|
|
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 >
|
116 |
if maxval > threshold:
|
117 |
print("Toxic")
|
118 |
affirm = positive_affirmations()
|
@@ -122,7 +122,7 @@ def classify_toxicity(audio_file, classify_anxiety, emo_class, explitive_selecti
|
|
122 |
affirm = ""
|
123 |
topScore = maxval
|
124 |
else:
|
125 |
-
if
|
126 |
affirm = positive_affirmations()
|
127 |
topScore = toxicity_score
|
128 |
else:
|
|
|
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 > toxicity_score:
|
116 |
if maxval > threshold:
|
117 |
print("Toxic")
|
118 |
affirm = positive_affirmations()
|
|
|
122 |
affirm = ""
|
123 |
topScore = maxval
|
124 |
else:
|
125 |
+
if toxicity_score > threshold:
|
126 |
affirm = positive_affirmations()
|
127 |
topScore = toxicity_score
|
128 |
else:
|