KeshavRa commited on
Commit
e6ffb3a
Β·
verified Β·
1 Parent(s): a2cf973

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -14
app.py CHANGED
@@ -157,20 +157,21 @@ if selected_app == "1) Create CSVs":
157
  if st.session_state.submit:
158
  if uploaded_files:
159
  client = OpenAI(api_key=openai_api_key)
160
-
161
- # test api key
162
- try:
163
- response = client.chat.completions.create(
164
- model="gpt-4o-mini",
165
- messages=[
166
- {"role": "system", "content": "You are a helpful assistant."},
167
- {"role": "user", "content": "Say this is a test"}
168
- ]
169
- )
170
- except:
171
- st.session_state.clear()
172
- st.session_state.error = "OpenAI API key is invalid"
173
- st.rerun()
 
174
 
175
  with st.spinner("Loading, please be patient with us ... πŸ™"):
176
  textify_output = read_and_textify_advanced(uploaded_files, sentence_chunks)
 
157
  if st.session_state.submit:
158
  if uploaded_files:
159
  client = OpenAI(api_key=openai_api_key)
160
+
161
+ with st.spinner("Loading, please be patient with us ... πŸ™"):
162
+ # test api key
163
+ try:
164
+ response = client.chat.completions.create(
165
+ model="gpt-4o-mini",
166
+ messages=[
167
+ {"role": "system", "content": "You are a helpful assistant."},
168
+ {"role": "user", "content": "Say this is a test"}
169
+ ]
170
+ )
171
+ except:
172
+ st.session_state.clear()
173
+ st.session_state.error = "OpenAI API key is invalid"
174
+ st.rerun()
175
 
176
  with st.spinner("Loading, please be patient with us ... πŸ™"):
177
  textify_output = read_and_textify_advanced(uploaded_files, sentence_chunks)