Update app.py
Browse files
app.py
CHANGED
|
@@ -10,6 +10,8 @@ from datetime import timedelta
|
|
| 10 |
from pyannote.audio import Pipeline
|
| 11 |
from huggingface_hub import hf_hub_download
|
| 12 |
# Import ALL required classes for Safe Globals whitelisting
|
|
|
|
|
|
|
| 13 |
from pyannote.audio.core.task import Specifications, Problem, Resolution
|
| 14 |
|
| 15 |
# --- Configuration & Tokens ---
|
|
@@ -236,8 +238,9 @@ if uploaded_file:
|
|
| 236 |
# Diarization Preview to help the user identify roles
|
| 237 |
with st.expander("Transcript Preview (Diarized)"):
|
| 238 |
for seg in st.session_state.transcript[:20]: # Show first 20 segments
|
| 239 |
-
# FIXED:
|
| 240 |
-
|
|
|
|
| 241 |
|
| 242 |
brief = st.text_area("Creative Brief", placeholder="e.g. Focus on the yeast story, remove the interviewer.")
|
| 243 |
|
|
|
|
| 10 |
from pyannote.audio import Pipeline
|
| 11 |
from huggingface_hub import hf_hub_download
|
| 12 |
# Import ALL required classes for Safe Globals whitelisting
|
| 13 |
+
# Note: Some internal classes might not be directly importable, so we use string references if needed
|
| 14 |
+
# but these are the main ones exposed by the library.
|
| 15 |
from pyannote.audio.core.task import Specifications, Problem, Resolution
|
| 16 |
|
| 17 |
# --- Configuration & Tokens ---
|
|
|
|
| 238 |
# Diarization Preview to help the user identify roles
|
| 239 |
with st.expander("Transcript Preview (Diarized)"):
|
| 240 |
for seg in st.session_state.transcript[:20]: # Show first 20 segments
|
| 241 |
+
# FIXED: Simple string concatenation to avoid syntax errors
|
| 242 |
+
display_text = f"**{seg['speaker']}:** {seg['text']}"
|
| 243 |
+
st.markdown(display_text)
|
| 244 |
|
| 245 |
brief = st.text_area("Creative Brief", placeholder="e.g. Focus on the yeast story, remove the interviewer.")
|
| 246 |
|