Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -3,6 +3,11 @@ import pandas as pd
|
|
3 |
import openai
|
4 |
from text_speech_utils import * # Assuming this module exists for your audio functionality
|
5 |
|
|
|
|
|
|
|
|
|
|
|
6 |
# Initialize app
|
7 |
if 'messages' not in st.session_state:
|
8 |
st.session_state['messages'] = [{"role": "system", "content": "You are a helpful assistant."}]
|
@@ -42,4 +47,4 @@ if st.button('Record audio'):
|
|
42 |
# Download conversation button
|
43 |
st.download_button(label="Download conversation",
|
44 |
data=pd.DataFrame(st.session_state['messages']).to_csv(index=False).encode('utf-8'),
|
45 |
-
file_name=output_conversation_filename)
|
|
|
3 |
import openai
|
4 |
from text_speech_utils import * # Assuming this module exists for your audio functionality
|
5 |
|
6 |
+
# Define filenames for audio and conversation output
|
7 |
+
input_audio_filename = 'input.wav'
|
8 |
+
output_audio_filename = 'chatgpt_response.wav'
|
9 |
+
output_conversation_filename = 'ChatGPT_conversation.txt'
|
10 |
+
|
11 |
# Initialize app
|
12 |
if 'messages' not in st.session_state:
|
13 |
st.session_state['messages'] = [{"role": "system", "content": "You are a helpful assistant."}]
|
|
|
47 |
# Download conversation button
|
48 |
st.download_button(label="Download conversation",
|
49 |
data=pd.DataFrame(st.session_state['messages']).to_csv(index=False).encode('utf-8'),
|
50 |
+
file_name=output_conversation_filename)
|