mskov commited on
Commit
b074e3e
·
1 Parent(s): 256341a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
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, "r") as f:
24
- transcribed_text = f
 
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)