Illia56 commited on
Commit
43773a4
1 Parent(s): 7ba6cba

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -4
app.py CHANGED
@@ -1,6 +1,6 @@
1
  import streamlit as st
2
  from gradio_client import Client
3
- from audio_recorder_streamlit import audio_recorder
4
 
5
 
6
  # Constants
@@ -72,6 +72,12 @@ if prompt := st.chat_input("Ask LLama-2-70b anything..."):
72
  # Add assistant response to chat history
73
  st.session_state.messages.append({"role": "assistant", "content": response})
74
 
75
- audio_bytes = audio_recorder()
76
- if audio_bytes:
77
- st.audio(audio_bytes, format="audio/wav")
 
 
 
 
 
 
 
1
  import streamlit as st
2
  from gradio_client import Client
3
+ from st_audiorec import st_audiorec
4
 
5
 
6
  # Constants
 
72
  # Add assistant response to chat history
73
  st.session_state.messages.append({"role": "assistant", "content": response})
74
 
75
+ wav_audio_data = st_audiorec()
76
+
77
+ if wav_audio_data is not None:
78
+ # Save audio bytes
79
+ with open("audio.wav", "wb") as f:
80
+ f.write(audio_bytes)
81
+
82
+
83
+