Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
import streamlit as st
|
2 |
from gradio_client import Client
|
3 |
-
from
|
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 |
-
|
76 |
-
|
77 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
|