Spaces:
Sleeping
Sleeping
Commit Β·
08ce86f
1
Parent(s): 613fc2a
bugfix
Browse files- src/streamlit_app.py +12 -12
src/streamlit_app.py
CHANGED
|
@@ -403,7 +403,7 @@ with tab3:
|
|
| 403 |
elif not st.session_state.get('transcription_in_progress', False):
|
| 404 |
with transcript_placeholder.container():
|
| 405 |
st.info("No transcript available. Click 'Transcribe Audio' to generate one.")
|
| 406 |
-
|
| 407 |
# ===== Summarization Process =====
|
| 408 |
if st.button("π Generate Summary", key="summarize_button_tab3"):
|
| 409 |
if st.session_state.transcript:
|
|
@@ -412,11 +412,14 @@ with tab3:
|
|
| 412 |
st.session_state.summary = ""
|
| 413 |
|
| 414 |
try:
|
| 415 |
-
#
|
| 416 |
-
|
| 417 |
|
| 418 |
-
#
|
| 419 |
-
|
|
|
|
|
|
|
|
|
|
| 420 |
st.markdown("### π Live Summary (In Progress)")
|
| 421 |
progress_placeholder = st.empty()
|
| 422 |
|
|
@@ -435,13 +438,10 @@ with tab3:
|
|
| 435 |
duration = time.time() - start_time
|
| 436 |
debug_log(f"Summary completed: {char_count} chars in {duration:.1f}s", "INFO")
|
| 437 |
|
| 438 |
-
# Clear the
|
| 439 |
-
|
| 440 |
-
|
| 441 |
-
# β
Clear previous summary before showing new one
|
| 442 |
-
summary_container.empty()
|
| 443 |
|
| 444 |
-
# Now
|
| 445 |
with summary_container:
|
| 446 |
st.markdown("### π Final Summary")
|
| 447 |
st.markdown(st.session_state.summary)
|
|
@@ -452,6 +452,6 @@ with tab3:
|
|
| 452 |
debug_log(f"Summarization failed: {str(e)}", "ERROR")
|
| 453 |
status_placeholder.error(f"Summary error: {str(e)}")
|
| 454 |
else:
|
| 455 |
-
status_placeholder.warning("β οΈ No transcript available")
|
| 456 |
|
| 457 |
debug_log("Tab3 rendering completed", "STATE")
|
|
|
|
| 403 |
elif not st.session_state.get('transcription_in_progress', False):
|
| 404 |
with transcript_placeholder.container():
|
| 405 |
st.info("No transcript available. Click 'Transcribe Audio' to generate one.")
|
| 406 |
+
|
| 407 |
# ===== Summarization Process =====
|
| 408 |
if st.button("π Generate Summary", key="summarize_button_tab3"):
|
| 409 |
if st.session_state.transcript:
|
|
|
|
| 412 |
st.session_state.summary = ""
|
| 413 |
|
| 414 |
try:
|
| 415 |
+
# β
Clear any existing summary content before starting
|
| 416 |
+
summary_container.empty()
|
| 417 |
|
| 418 |
+
# Use a temporary placeholder for live summary updates (outside summary_container)
|
| 419 |
+
live_summary_area = st.empty()
|
| 420 |
+
|
| 421 |
+
# Show live summary header and content inside the temporary area
|
| 422 |
+
with live_summary_area:
|
| 423 |
st.markdown("### π Live Summary (In Progress)")
|
| 424 |
progress_placeholder = st.empty()
|
| 425 |
|
|
|
|
| 438 |
duration = time.time() - start_time
|
| 439 |
debug_log(f"Summary completed: {char_count} chars in {duration:.1f}s", "INFO")
|
| 440 |
|
| 441 |
+
# β
Clear the live summary area completely
|
| 442 |
+
live_summary_area.empty()
|
|
|
|
|
|
|
|
|
|
| 443 |
|
| 444 |
+
# β
Now show only the final summary in summary_container
|
| 445 |
with summary_container:
|
| 446 |
st.markdown("### π Final Summary")
|
| 447 |
st.markdown(st.session_state.summary)
|
|
|
|
| 452 |
debug_log(f"Summarization failed: {str(e)}", "ERROR")
|
| 453 |
status_placeholder.error(f"Summary error: {str(e)}")
|
| 454 |
else:
|
| 455 |
+
status_placeholder.warning("β οΈ No transcript available")
|
| 456 |
|
| 457 |
debug_log("Tab3 rendering completed", "STATE")
|