Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -89,7 +89,6 @@ def create_file(filename, prompt, response):
|
|
89 |
file.write(f"# Prompt: \n'''{prompt}'''\n # Response: \n'''{response}'''")
|
90 |
else:
|
91 |
st.error("Unsupported file type!")
|
92 |
-
|
93 |
def main():
|
94 |
st.sidebar.header("Choose your Input Method:")
|
95 |
input_choice = st.sidebar.radio("",('Type it out','Record it'))
|
@@ -107,8 +106,8 @@ def main():
|
|
107 |
elif input_choice == 'Record it':
|
108 |
st.header("Record your query")
|
109 |
st.write("Press record to start recording")
|
110 |
-
|
111 |
-
filename = save_and_play_audio(
|
112 |
if filename:
|
113 |
if st.button("Transcribe and Chat"):
|
114 |
transcription, response = transcribe_and_chat(openai.api_key, filename, "whisper-1")
|
|
|
89 |
file.write(f"# Prompt: \n'''{prompt}'''\n # Response: \n'''{response}'''")
|
90 |
else:
|
91 |
st.error("Unsupported file type!")
|
|
|
92 |
def main():
|
93 |
st.sidebar.header("Choose your Input Method:")
|
94 |
input_choice = st.sidebar.radio("",('Type it out','Record it'))
|
|
|
106 |
elif input_choice == 'Record it':
|
107 |
st.header("Record your query")
|
108 |
st.write("Press record to start recording")
|
109 |
+
recorder_instance = audio_recorder() # Here is the change
|
110 |
+
filename = save_and_play_audio(recorder_instance)
|
111 |
if filename:
|
112 |
if st.button("Transcribe and Chat"):
|
113 |
transcription, response = transcribe_and_chat(openai.api_key, filename, "whisper-1")
|