Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files23 unmodified lines2425262728296 unmodified lines36373839404142434445464748495051525323 unmodified linesselected_text = st.selectbox("λ°μ΄ν°λ₯Ό μ ννμΈμ", options)print(selected_text)# λ°μ΄ν° μν λ° μ‘°μΉ μν© νμ ν¨μdef display_status_and_action(text):if text == "":6 unmodified lineswarning = "β οΈ μΌμ μμΉ μ΄μμ Soot μΆμ λμ΄ 2μκ° μ΄μ μ§μλλ νμμ 보μ. \nSoot κ° μΌμ μμΉμ λλ¬νμλ μ μμ μΌλ‘ μ°μλμ§ μκ±°λ, μΌμ λΆλμΌλ‘ μΈν΄ Dosing μ΄ κ³Όνκ² νμ±νλ¨. \nsoot κ° μ¦κ°νλ κ³Όμ μμ λΆκ·μΉμ μΈ μ¦κ° νμμ΄ λ°μν¨. \nν λλ λΉμ ν ννκ° ν¬κ² λνλ¨. \nSoot μ μΆμ λμ΄ 40μ μ΄κ³Όνλ ꡬκ°μ΄ μ‘΄μ¬ν¨."st.warning(warning)st.markdown(text_input)if st.button("π€", help="μμ±μΌλ‘ λ£κΈ°"):text_input = warning + " " + text_inputcleaned_text = re.sub(r'[\x00-\x1F]+', '', text_input).replace("*", "")tts = gTTS(text=cleaned_text, lang='ko')mp3_fp = BytesIO()tts.write_to_fp(mp3_fp)# μ€λμ€ μ€νΈλ¦Ό μ¬μ€μ ν μ¬μmp3_fp.seek(0)st.audio(mp3_fp, format="audio/mp3")# μν λ° μ‘°μΉ μΆλ ₯display_status_and_action(selected_text)23 unmodified lines2425262728293031323334353637383940414243446 unmodified lines51525354555657585960616263646566676823 unmodified linesselected_text = st.selectbox("λ°μ΄ν°λ₯Ό μ ννμΈμ", options)print(selected_text)button_html = """<style>.icon-button {background: none;border: none;font-size: 32px;cursor: pointer;}</style><form action="" method="post"><button class="icon-button" type="submit" name="mic">π€</button></form>"""st.markdown(button_html, unsafe_allow_html=True)# λ°μ΄ν° μν λ° μ‘°μΉ μν© νμ ν¨μdef display_status_and_action(text):if text == "":6 unmodified lineswarning = "β οΈ μΌμ μμΉ μ΄μμ Soot μΆμ λμ΄ 2μκ° μ΄μ μ§μλλ νμμ 보μ. \nSoot κ° μΌμ μμΉμ λλ¬νμλ μ μμ μΌλ‘ μ°μλμ§ μκ±°λ, μΌμ λΆλμΌλ‘ μΈν΄ Dosing μ΄ κ³Όνκ² νμ±νλ¨. \nsoot κ° μ¦κ°νλ κ³Όμ μμ λΆκ·μΉμ μΈ μ¦κ° νμμ΄ λ°μν¨. \nν λλ λΉμ ν ννκ° ν¬κ² λνλ¨. \nSoot μ μΆμ λμ΄ 40μ μ΄κ³Όνλ ꡬκ°μ΄ μ‘΄μ¬ν¨."st.warning(warning)st.markdown(text_input)# λ²νΌ ν΄λ¦ μ²λ¦¬if st.session_state.get("mic", False) or st.experimental_get_query_params().get("mic"):text_input = warning + " " + text_inputcleaned_text = re.sub(r'[\x00-\x1F]+', '', text_input).replace("*", "")tts = gTTS(text=cleaned_text, lang='ko')mp3_fp = BytesIO()tts.write_to_fp(mp3_fp)mp3_fp.seek(0)st.audio(mp3_fp, format="audio/mp3")# μν λ° μ‘°μΉ μΆλ ₯display_status_and_action(selected_text)
src/streamlit_app.py+18-3