eaglelandsonce commited on
Commit
7709d6e
·
1 Parent(s): 8c48a8e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -12
app.py CHANGED
@@ -197,10 +197,25 @@ def main():
197
  os.remove(file)
198
  st.experimental_rerun()
199
 
200
-
201
-
 
 
202
  user_prompt = st.text_area("Enter prompts, instructions & questions:", '', height=100)
203
 
 
 
 
 
 
 
 
 
 
 
 
 
 
204
  if st.button('💬 Chat'):
205
  st.write('Reasoning with your inputs...')
206
  response = chat_with_model(user_prompt, ''.join(list(document_sections)))
@@ -211,16 +226,7 @@ def main():
211
  create_file(filename, user_prompt, response)
212
  st.sidebar.markdown(get_table_download_link(filename), unsafe_allow_html=True)
213
 
214
- from audio_recorder_streamlit import audio_recorder
215
- # Audio, transcribe, GPT:
216
- filename = save_and_play_audio(audio_recorder)
217
- if filename is not None:
218
- transcription = transcribe_audio(openai.api_key, filename, "whisper-1")
219
- st.write(transcription)
220
- gptOutput = chat_with_model(transcription, '') # push transcript through as prompt
221
- filename = generate_filename(transcription, choice)
222
- create_file(filename, transcription, gptOutput)
223
- st.sidebar.markdown(get_table_download_link(filename), unsafe_allow_html=True)
224
 
225
  else:
226
  # image and api warning before rest of code
 
197
  os.remove(file)
198
  st.experimental_rerun()
199
 
200
+
201
+
202
+ from audio_recorder_streamlit import audio_recorder
203
+
204
  user_prompt = st.text_area("Enter prompts, instructions & questions:", '', height=100)
205
 
206
+ # Audio, transcribe, GPT:
207
+ filename = save_and_play_audio(audio_recorder)
208
+ if filename is not None:
209
+ transcription = transcribe_audio(openai.api_key, filename, "whisper-1")
210
+ st.test_area(transcription, height = 100)
211
+ #gptOutput = chat_with_model(transcription, '') # push transcript through as prompt
212
+ user_prompt = transcription
213
+ filename = generate_filename(transcription, choice)
214
+ create_file(filename, transcription, gptOutput)
215
+ st.sidebar.markdown(get_table_download_link(filename), unsafe_allow_html=True)
216
+
217
+
218
+
219
  if st.button('💬 Chat'):
220
  st.write('Reasoning with your inputs...')
221
  response = chat_with_model(user_prompt, ''.join(list(document_sections)))
 
226
  create_file(filename, user_prompt, response)
227
  st.sidebar.markdown(get_table_download_link(filename), unsafe_allow_html=True)
228
 
229
+
 
 
 
 
 
 
 
 
 
230
 
231
  else:
232
  # image and api warning before rest of code