Spaces:
Sleeping
Sleeping
Update app.py
Browse files156 unmodified lines157158159160161162163164165166167168169170171172173174175176156 unmodified linesif st.session_state.submit:if uploaded_files:client = OpenAI(api_key=openai_api_key)# test api keytry:response = client.chat.completions.create(model="gpt-4o-mini",messages=[{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Say this is a test"}])except:st.session_state.clear()st.session_state.error = "OpenAI API key is invalid"st.rerun()with st.spinner("Loading, please be patient with us ... ๐"):textify_output = read_and_textify_advanced(uploaded_files, sentence_chunks)156 unmodified lines157158159160161162163164165166167168169170171172173174175176177156 unmodified linesif st.session_state.submit:if uploaded_files:client = OpenAI(api_key=openai_api_key)with st.spinner("Loading, please be patient with us ... ๐"):# test api keytry:response = client.chat.completions.create(model="gpt-4o-mini",messages=[{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Say this is a test"}])except:st.session_state.clear()st.session_state.error = "OpenAI API key is invalid"st.rerun()with st.spinner("Loading, please be patient with us ... ๐"):textify_output = read_and_textify_advanced(uploaded_files, sentence_chunks)
app.py+15-14