kobakhit commited on
Commit
4d32ff0
1 Parent(s): adeb0fa

openai internal server error

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -372,7 +372,12 @@ if "audio" in locals():
372
  with container_transcript_chat:
373
  # get a summary of transcript from ChatGpt
374
  st.session_state.messages[1]['content'] = st.session_state.messages[1]['content'].format(transcript_string)
375
- init = get_initial_response(st.session_state.messages)
 
 
 
 
 
376
  # pass transcript to initial prompt
377
 
378
 
 
372
  with container_transcript_chat:
373
  # get a summary of transcript from ChatGpt
374
  st.session_state.messages[1]['content'] = st.session_state.messages[1]['content'].format(transcript_string)
375
+ try:
376
+ init = get_initial_response(st.session_state.messages)
377
+ except openai.error.APIError:
378
+ # st.stop('It is not you. It is not this app. It is OpenAI API thats having issues.')
379
+ init = 'OpenAI API is having issues. Hope they resolve it soon. Refer to https://status.openai.com/'
380
+ st.warning(init)
381
  # pass transcript to initial prompt
382
 
383