Update app.py
Browse files
app.py
CHANGED
@@ -91,11 +91,11 @@ if st.session_state.audio_path and not st.session_state.transcription:
|
|
91 |
st.success("Audio extracted and ready for analysis!")
|
92 |
unload_model(st.session_state.whisper)
|
93 |
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
|
100 |
|
101 |
if st.session_state.transcription:
|
@@ -108,6 +108,9 @@ if st.session_state.transcription:
|
|
108 |
readable_accent, confidence = analyze_accent(waveform, sample_rate, st.session_state.classifier)
|
109 |
|
110 |
if readable_accent:
|
|
|
|
|
|
|
111 |
st.success(f"Accent Detected: **{readable_accent}**")
|
112 |
st.info(f"Confidence: {confidence}%")
|
113 |
|
|
|
91 |
st.success("Audio extracted and ready for analysis!")
|
92 |
unload_model(st.session_state.whisper)
|
93 |
|
94 |
+
if 'classifier' not in st.session_state:
|
95 |
+
st.session_state.classifier = load_accent_model()
|
96 |
+
mem = psutil.virtual_memory()
|
97 |
+
st.write(f"Memory used: {mem.percent}%")
|
98 |
+
time.sleep(5)
|
99 |
|
100 |
|
101 |
if st.session_state.transcription:
|
|
|
108 |
readable_accent, confidence = analyze_accent(waveform, sample_rate, st.session_state.classifier)
|
109 |
|
110 |
if readable_accent:
|
111 |
+
st.audio(st.session_state.audio_path, format='audio/wav')
|
112 |
+
st.markdown(" Transcript Preview")
|
113 |
+
st.markdown(st.session_state.transcription)
|
114 |
st.success(f"Accent Detected: **{readable_accent}**")
|
115 |
st.info(f"Confidence: {confidence}%")
|
116 |
|