Momal commited on
Commit
8a774a8
·
1 Parent(s): 7069fd5

fixd openai key

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -6,9 +6,9 @@ st.title('Mental Health Assistant :broken_heart:')
6
 
7
  # Create a text input box for the OpenAI key
8
  openai_key = st.text_input('Enter your OpenAI Key', type='password')
9
-
10
  # Display the key when the user presses the 'Submit' button
11
- if st.button('Subimt') and openai_key:
12
  query = st.text_input('Enter your query', type='default')
13
  if query:
14
  try:
@@ -16,5 +16,5 @@ if st.button('Subimt') and openai_key:
16
  print("response",response)
17
  except Exception as e:
18
  st.error(f'An error occurred: {e}',icon=':no_entry_sign:')
19
- elif st.button('Submit') and not openai_key:
20
  st.error('Please enter your OpenAI key',icon="🚨")
 
6
 
7
  # Create a text input box for the OpenAI key
8
  openai_key = st.text_input('Enter your OpenAI Key', type='password')
9
+ key_submit = st.button('Subimt')
10
  # Display the key when the user presses the 'Submit' button
11
+ if key_submit and openai_key:
12
  query = st.text_input('Enter your query', type='default')
13
  if query:
14
  try:
 
16
  print("response",response)
17
  except Exception as e:
18
  st.error(f'An error occurred: {e}',icon=':no_entry_sign:')
19
+ elif key_submit and not openai_key:
20
  st.error('Please enter your OpenAI key',icon="🚨")