Spaces:
Runtime error
Runtime error
Update streamlit_app.py to fix error : 'not find proc and mod'
Browse files- src/streamlit_app.py +3 -3
src/streamlit_app.py
CHANGED
|
@@ -90,9 +90,9 @@ def highlight_toxic_span(words, labels):
|
|
| 90 |
|
| 91 |
if st.button("Transcript and Detect Toxic Spans Now"):
|
| 92 |
waveform, _ = librosa.load(audio_path, sr=16000)
|
| 93 |
-
input_features =
|
| 94 |
-
predicted_ids =
|
| 95 |
-
transcript_text =
|
| 96 |
|
| 97 |
st.subheader("Result")
|
| 98 |
enc = tsd_tokenizer(list([transcript_text]), is_split_into_words=True,
|
|
|
|
| 90 |
|
| 91 |
if st.button("Transcript and Detect Toxic Spans Now"):
|
| 92 |
waveform, _ = librosa.load(audio_path, sr=16000)
|
| 93 |
+
input_features = asr_processor(waveform, return_tensors="pt", sampling_rate=16000).input_features.to("cpu")
|
| 94 |
+
predicted_ids = asr_model.generate(input_features)
|
| 95 |
+
transcript_text = asr_processor.batch_decode(predicted_ids, skip_special_tokens=True)[0]
|
| 96 |
|
| 97 |
st.subheader("Result")
|
| 98 |
enc = tsd_tokenizer(list([transcript_text]), is_split_into_words=True,
|