Nyanfa commited on
Commit
5b4675a
·
verified ·
1 Parent(s): 95f42b1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -9,7 +9,7 @@ st.title("Cohere Chat UI")
9
  if "api_key" not in st.session_state:
10
  api_key = st.text_input("Enter your API Key", type="password")
11
  if api_key:
12
- if isascii(api_key):
13
  st.session_state.api_key = api_key
14
  client = cohere.Client(api_key=api_key)
15
  st.rerun()
@@ -183,7 +183,7 @@ with st.sidebar:
183
  st.header("Change API Key")
184
  new_api_key = st.text_input("Enter new API Key", type="password")
185
  if st.button("Update API Key"):
186
- if new_api_key and isascii(new_api_key):
187
  st.session_state.api_key = new_api_key
188
  client = cohere.Client(api_key=new_api_key)
189
  st.success("API Key updated successfully!")
 
9
  if "api_key" not in st.session_state:
10
  api_key = st.text_input("Enter your API Key", type="password")
11
  if api_key:
12
+ if api_key.isascii():
13
  st.session_state.api_key = api_key
14
  client = cohere.Client(api_key=api_key)
15
  st.rerun()
 
183
  st.header("Change API Key")
184
  new_api_key = st.text_input("Enter new API Key", type="password")
185
  if st.button("Update API Key"):
186
+ if new_api_key and new_api_key.isascii():
187
  st.session_state.api_key = new_api_key
188
  client = cohere.Client(api_key=new_api_key)
189
  st.success("API Key updated successfully!")