Update app.py
Browse files
app.py
CHANGED
@@ -74,11 +74,19 @@ textinput = st.chat_input("Ask LLama-2-70b anything...")
|
|
74 |
wav_audio_data = st_audiorec()
|
75 |
|
76 |
if wav_audio_data != None:
|
77 |
-
|
78 |
-
|
79 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
# transcribe audio
|
81 |
-
response = predict(message=
|
82 |
|
83 |
with st.chat_message("assistant", avatar='🦙'):
|
84 |
st.markdown(response)
|
|
|
74 |
wav_audio_data = st_audiorec()
|
75 |
|
76 |
if wav_audio_data != None:
|
77 |
+
with st.status("Transcribing audio"):
|
78 |
+
# save audio
|
79 |
+
with open("audio.wav", "wb") as f:
|
80 |
+
f.write(wav_audio_data)
|
81 |
+
prompt = transcribe("audio.wav")
|
82 |
+
st.chat_message("human",avatar = "🧑💻").markdown(prompt)
|
83 |
+
# Add user message to chat history
|
84 |
+
st.session_state.messages.append({"role": "human", "content": prompt})
|
85 |
+
|
86 |
+
st.write("Transcribed audio")
|
87 |
+
|
88 |
# transcribe audio
|
89 |
+
response = predict(message= prompt)
|
90 |
|
91 |
with st.chat_message("assistant", avatar='🦙'):
|
92 |
st.markdown(response)
|