voice input [test mode]: fix show input
This commit is contained in:
parent
4ffd4f18c2
commit
1f31f7856b
2
chat.py
2
chat.py
@ -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()
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user