Spaces:
Runtime error
Runtime error
File size: 2,358 Bytes
d99f4b8 5f30f3a d99f4b8 5f30f3a d99f4b8 5f30f3a d99f4b8 5f30f3a d99f4b8 5f30f3a d99f4b8 5f30f3a d99f4b8 5f30f3a d99f4b8 5f30f3a d99f4b8 5f30f3a d99f4b8 5f30f3a d99f4b8 5f30f3a d99f4b8 5f30f3a d99f4b8 5f30f3a d99f4b8 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
from main import *
if __name__ == '__main__':
config()
if st.session_state['page_index'] == -1:
# Specify token page (mandatory to use the diarization option)
st.warning('You must specify a token to use the diarization model. Otherwise, the app will be launched without this model. You can learn how to create your token here: https://huggingface.co/pyannote/speaker-diarization / λΆν λͺ¨λΈμ μ¬μ©νλ €λ©΄ ν ν°μ μ§μ ν΄μΌ ν©λλ€. κ·Έλ μ§ μμΌλ©΄ μ΄ λͺ¨λΈ μμ΄ μ±μ΄ μ€νλ©λλ€. μ¬κΈ°μμ ν ν°μ λ§λλ λ°©λ²μ λ°°μΈ μ μμ΅λλ€: https://huggingface.co/pyannote/speaker-diarization')
text_input = st.text_input("Enter your Hugging Face token: / Hugging Face ν ν°μ μ
λ ₯νμΈμ:", placeholder="ACCESS_TOKEN_GOES_HERE", type="password")
# Confirm or continue without the option
col1, col2 = st.columns(2)
# Save changes button
with col1:
confirm_btn = st.button("I have changed my token / ν ν°μ λ³κ²½νμ΅λλ€", on_click=confirm_token_change, args=(text_input, 0), disabled=st.session_state["disable"])
# if text is changed, button is clickable
if text_input != "ACCESS_TOKEN_GOES_HERE":
st.session_state["disable"] = False
# Continue without a token (there will be no diarization option)
with col2:
dont_mind_btn = st.button("Continue without this option / μ΄ μ΅μ
μμ΄ κ³μνμμμ€", on_click=update_session_state, args=("page_index", 0))
if st.session_state['page_index'] == 0:
# Home page
choice = st.radio("Features / νΉμ§", ["By a video URL / λΉλμ€ URLλ‘", "By uploading a file / νμΌμ μ
λ‘λνμ¬"])
stt_tokenizer, stt_model, summarizer, dia_pipeline = load_models()
if choice == "By a video URL / λΉλμ€ URLλ‘":
transcript_from_url(stt_tokenizer, stt_model, summarizer, dia_pipeline)
elif choice == "By uploading a file / νμΌμ μ
λ‘λνμ¬":
transcript_from_file(stt_tokenizer, stt_model, summarizer, dia_pipeline)
elif st.session_state['page_index'] == 1:
# Display Results page
display_results()
elif st.session_state['page_index'] == 2:
# Rename speakers page
rename_speakers_window() |