Skip to content

Commit

Permalink
fix: empty api key is allowed to run
Browse files Browse the repository at this point in the history
  • Loading branch information
sean1832 committed Mar 26, 2023
1 parent 32a78ce commit a0e2621
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/SumGPT.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,9 @@
if st.button("🚀 Run", disabled=exceeded):
start_time = time.time()
st.cache_data.clear()
util.clear_cache('summary')
API_KEY = st.session_state['OPENAI_API_KEY']
if not API_KEY and GPT.misc.validate_api_key(API_KEY):
if not API_KEY and not GPT.misc.validate_api_key(API_KEY):
st.error("❌ Please enter a valid [OpenAI API key](https://beta.openai.com/account/api-keys).")
else:
with st.spinner("Summarizing... (this might take a while)"):
Expand Down

0 comments on commit a0e2621

Please sign in to comment.