ViToSAResearch commited on
Commit
06e0207
·
verified ·
1 Parent(s): 2665383

Update streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +8 -8
src/streamlit_app.py CHANGED
@@ -50,13 +50,13 @@ tsd_path = "Huydb/PhoBERT-toxic"
50
  tsd_tokenizer, tsd_model = load_tsd(tsd_path)
51
 
52
  # --- Streamlit UI ---
53
- # st.markdown("""
54
- # <style> /* CSS animation & button */
55
- # @keyframes bgfade {0%{background-color:white;}50%{background-color:#889ECE;}100%{background-color:white;}}
56
- # html, body, .reportview-container, .main {height:100%!important; margin:0; padding:0; animation:bgfade 10s ease infinite;}
57
- # div.stButton>button:first-child{background-color:red!important;color:white!important;border:none;}
58
- # </style>
59
- # """, unsafe_allow_html=True)
60
 
61
  st.title("🔊🤬 Toxic Spans Detection from Audio")
62
  uploaded_audio = st.file_uploader("1. Upload a WAV audio file", type=["wav"])
@@ -96,4 +96,4 @@ if st.button("Transcript and Detect Toxic Spans Now"):
96
  labels = logits.argmax(-1)[0].cpu().tolist()
97
  sen_hide = highlight_toxic_span(transcript_text.split(), labels)
98
 
99
- st.markdown(f"<h1 style='text-align: center;'>{sen_hide}</h1>", unsafe_allow_html=True)
 
50
  tsd_tokenizer, tsd_model = load_tsd(tsd_path)
51
 
52
  # --- Streamlit UI ---
53
+ st.markdown("""
54
+ <style> /* CSS animation & button */
55
+ @keyframes bgfade {0%{background-color:white;}50%{background-color:#889ECE;}100%{background-color:white;}}
56
+ html, body, .reportview-container, .main {height:100%!important; margin:0; padding:0; animation:bgfade 10s ease infinite;}
57
+ div.stButton>button:first-child{background-color:red!important;color:white!important;border:none;}
58
+ </style>
59
+ """, unsafe_allow_html=True)
60
 
61
  st.title("🔊🤬 Toxic Spans Detection from Audio")
62
  uploaded_audio = st.file_uploader("1. Upload a WAV audio file", type=["wav"])
 
96
  labels = logits.argmax(-1)[0].cpu().tolist()
97
  sen_hide = highlight_toxic_span(transcript_text.split(), labels)
98
 
99
+ st.markdown(f"<h1 style='text-align: center; color: red;'>{sen_hide}</h1>", unsafe_allow_html=True)