Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -36,15 +36,15 @@ pipe = pipeline("automatic-speech-recognition", model="openai/whisper-large")
|
|
36 |
def slider_logic(slider):
|
37 |
threshold = 0
|
38 |
if slider == 1:
|
39 |
-
threshold = .
|
40 |
elif slider == 2:
|
41 |
-
threshold = .
|
42 |
elif slider == 3:
|
43 |
-
threshold = .
|
44 |
elif slider == 4:
|
45 |
-
threshold = .
|
46 |
elif slider == 5:
|
47 |
-
threshold = .
|
48 |
else:
|
49 |
threshold = []
|
50 |
return threshold
|
@@ -95,6 +95,7 @@ def classify_toxicity(audio_file, selected_sounds, slider):
|
|
95 |
if selected_class_name in class_score_dict:
|
96 |
score = class_score_dict[selected_class_name]
|
97 |
matching_label_score[selected_class_name] = score
|
|
|
98 |
|
99 |
# iterate through matching_label_score to check if any scores exceed the threshold
|
100 |
for label, score in matching_label_score.items():
|
|
|
36 |
def slider_logic(slider):
|
37 |
threshold = 0
|
38 |
if slider == 1:
|
39 |
+
threshold = .98
|
40 |
elif slider == 2:
|
41 |
+
threshold = .88
|
42 |
elif slider == 3:
|
43 |
+
threshold = .78
|
44 |
elif slider == 4:
|
45 |
+
threshold = .68
|
46 |
elif slider == 5:
|
47 |
+
threshold = .58
|
48 |
else:
|
49 |
threshold = []
|
50 |
return threshold
|
|
|
95 |
if selected_class_name in class_score_dict:
|
96 |
score = class_score_dict[selected_class_name]
|
97 |
matching_label_score[selected_class_name] = score
|
98 |
+
print("matching label score type is ", type(matching_label_score))
|
99 |
|
100 |
# iterate through matching_label_score to check if any scores exceed the threshold
|
101 |
for label, score in matching_label_score.items():
|