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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -20,7 +20,8 @@ def classify_toxicity(audio_file, text_file, selected_model):
20
  # Extract the transcribed text
21
  transcribed_text = transcription_results["transcription"]
22
  else:
23
- transcribed_text = open(text_file, "r")
 
24
 
25
  # Load the selected toxicity classification model
26
  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, "r") as f:
24
+ transcribed_text = f
25
 
26
  # Load the selected toxicity classification model
27
  toxicity_module = evaluate.load("toxicity", selected_model)