Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -20,8 +20,9 @@ def classify_toxicity(audio_file, text_file, selected_model):
|
|
| 20 |
# Extract the transcribed text
|
| 21 |
transcribed_text = transcription_results["transcription"]
|
| 22 |
else:
|
| 23 |
-
with open(text_file
|
| 24 |
-
|
|
|
|
| 25 |
|
| 26 |
# Load the selected toxicity classification model
|
| 27 |
toxicity_module = evaluate.load("toxicity", selected_model)
|
|
|
|
| 20 |
# Extract the transcribed text
|
| 21 |
transcribed_text = transcription_results["transcription"]
|
| 22 |
else:
|
| 23 |
+
with open(text_file) as f:
|
| 24 |
+
for line in f:
|
| 25 |
+
transcribed_text.append(line)
|
| 26 |
|
| 27 |
# Load the selected toxicity classification model
|
| 28 |
toxicity_module = evaluate.load("toxicity", selected_model)
|