voice input [test mode]: fix show input

This commit is contained in:
if 2023-04-08 15:33:36 +03:00
parent 4ffd4f18c2
commit 1f31f7856b
2 changed files with 3 additions and 5 deletions

View File

@ -97,7 +97,6 @@ if __name__ == "__main__":
case _:
st.session_state.locale = en
st.markdown(f"<h1 style='text-align: center;'>{st.session_state.locale.title}</h1>", unsafe_allow_html=True)
st.markdown("---")
selected_footer = option_menu(
menu_title=None,
options=[
@ -111,7 +110,6 @@ if __name__ == "__main__":
orientation="horizontal",
styles=FOOTER_STYLES
)
st.markdown("---")
match selected_footer:
case st.session_state.locale.footer_option0:
main()

View File

@ -67,15 +67,15 @@ def show_voice_input() -> None:
st.session_state.input = {"text": "", "session": 0}
result = get_bokeh_result()
tr = st.empty()
tr.text_area("TEST", value=st.session_state.input["text"])
tr.code(st.session_state.input["text"])
if result:
if "GET_TEXT" in result and (
result.get("GET_TEXT")["t"] != "" and result.get("GET_TEXT")["s"] != st.session_state.input["session"]):
st.session_state.input["text"] = result.get("GET_TEXT")["t"]
tr.text_area("TEST", value=st.session_state.input["text"])
tr.code(st.session_state.input["text"])
st.session_state.input["session"] = result.get("GET_TEXT")["s"]
if "GET_INTRM" in result and result.get("GET_INTRM") != "":
tr.text_area("TEST", value=st.session_state.input["text"] + " " + result.get("GET_INTRM"))
tr.code(st.session_state.input["text"] + " " + result.get("GET_INTRM"))
if "GET_ONREC" in result:
if result.get("GET_ONREC") == "start":
st.image(REC_GIF)