Spaces:
Build error
Build error
Commit
·
35b62b6
1
Parent(s):
30e2b7a
Update app.py
Browse files
app.py
CHANGED
@@ -18,7 +18,8 @@ from audio_recorder_streamlit import audio_recorder
|
|
18 |
|
19 |
import streamlit as st
|
20 |
|
21 |
-
st.session_state
|
|
|
22 |
|
23 |
st.set_page_config(page_title="Chat Toolkit",layout="wide")
|
24 |
|
@@ -208,9 +209,7 @@ def main():
|
|
208 |
filename = save_and_play_audio(audio_recorder)
|
209 |
if filename is not None:
|
210 |
transcription = transcribe_audio(openai.api_key, filename, "whisper-1")
|
211 |
-
|
212 |
-
json_str2 = json.dumps(transcription, indent=4)
|
213 |
-
my_prompt.value = json_str2
|
214 |
|
215 |
|
216 |
|
|
|
18 |
|
19 |
import streamlit as st
|
20 |
|
21 |
+
if 'text_content' not in st.session_state:
|
22 |
+
st.session_state.text_content = ''
|
23 |
|
24 |
st.set_page_config(page_title="Chat Toolkit",layout="wide")
|
25 |
|
|
|
209 |
filename = save_and_play_audio(audio_recorder)
|
210 |
if filename is not None:
|
211 |
transcription = transcribe_audio(openai.api_key, filename, "whisper-1")
|
212 |
+
my_prompt.value = st.session_state.text_content = transcription
|
|
|
|
|
213 |
|
214 |
|
215 |
|