devchavda11 commited on
Commit
0a78f99
·
verified ·
1 Parent(s): c348a15

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +4 -2
src/streamlit_app.py CHANGED
@@ -49,7 +49,9 @@ def load_session_state():
49
 
50
  def render_sidebar():
51
  with st.sidebar:
52
- st.audio_input("🎙️ Speak here :" , key="mic")
 
 
53
  st.title("Chats")
54
  if st.button("➕ New Chat"):
55
  new_id = str(uuid.uuid4())
@@ -116,7 +118,7 @@ render_sidebar()
116
  if "current_chat_id" in st.session_state:
117
  loadchats()
118
  user_input = st.chat_input("Your message:")
119
- if st.session_state.mic:
120
  audio = st.session_state.mic
121
  st.session_state.mic = None
122
  # st.session_state.tospeak = True
 
49
 
50
  def render_sidebar():
51
  with st.sidebar:
52
+ audio_file = st.audio_input("🎙️ Speak here :" , key="mic")
53
+ if audio_file:
54
+ st.session_state.mic = audio_file
55
  st.title("Chats")
56
  if st.button("➕ New Chat"):
57
  new_id = str(uuid.uuid4())
 
118
  if "current_chat_id" in st.session_state:
119
  loadchats()
120
  user_input = st.chat_input("Your message:")
121
+ if if "mic" in st.session_state and st.session_state.mic is not None:
122
  audio = st.session_state.mic
123
  st.session_state.mic = None
124
  # st.session_state.tospeak = True