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 _:
|
case _:
|
||||||
st.session_state.locale = en
|
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(f"<h1 style='text-align: center;'>{st.session_state.locale.title}</h1>", unsafe_allow_html=True)
|
||||||
st.markdown("---")
|
|
||||||
selected_footer = option_menu(
|
selected_footer = option_menu(
|
||||||
menu_title=None,
|
menu_title=None,
|
||||||
options=[
|
options=[
|
||||||
@ -111,7 +110,6 @@ if __name__ == "__main__":
|
|||||||
orientation="horizontal",
|
orientation="horizontal",
|
||||||
styles=FOOTER_STYLES
|
styles=FOOTER_STYLES
|
||||||
)
|
)
|
||||||
st.markdown("---")
|
|
||||||
match selected_footer:
|
match selected_footer:
|
||||||
case st.session_state.locale.footer_option0:
|
case st.session_state.locale.footer_option0:
|
||||||
main()
|
main()
|
||||||
|
@ -67,15 +67,15 @@ def show_voice_input() -> None:
|
|||||||
st.session_state.input = {"text": "", "session": 0}
|
st.session_state.input = {"text": "", "session": 0}
|
||||||
result = get_bokeh_result()
|
result = get_bokeh_result()
|
||||||
tr = st.empty()
|
tr = st.empty()
|
||||||
tr.text_area("TEST", value=st.session_state.input["text"])
|
tr.code(st.session_state.input["text"])
|
||||||
if result:
|
if result:
|
||||||
if "GET_TEXT" in result and (
|
if "GET_TEXT" in result and (
|
||||||
result.get("GET_TEXT")["t"] != "" and result.get("GET_TEXT")["s"] != st.session_state.input["session"]):
|
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"]
|
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"]
|
st.session_state.input["session"] = result.get("GET_TEXT")["s"]
|
||||||
if "GET_INTRM" in result and result.get("GET_INTRM") != "":
|
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 "GET_ONREC" in result:
|
||||||
if result.get("GET_ONREC") == "start":
|
if result.get("GET_ONREC") == "start":
|
||||||
st.image(REC_GIF)
|
st.image(REC_GIF)
|
||||||
|
Loading…
Reference in New Issue
Block a user