Ben Burtenshaw commited on
Commit
2271f96
1 Parent(s): 5c14bc8

use session state hub_token

Browse files
Files changed (1) hide show
  1. utils.py +2 -5
utils.py CHANGED
@@ -31,12 +31,9 @@ def project_sidebar():
31
  st.session_state["project_name"] = project_name
32
  st.session_state["hub_username"] = hub_username
33
  st.session_state["hub_token"] = st.sidebar.text_input(
34
- "Hub Token", type="password", value=None
35
  )
36
- if (
37
- st.sidebar.checkbox("Save Hub Token")
38
- and st.session_state["hub_token"] is not None
39
- ):
40
  os.environ["HF_TOKEN"] = st.session_state["hub_token"]
41
  st.sidebar.link_button(
42
  "🤗 Get your Hub Token", "https://huggingface.co/settings/tokens"
 
31
  st.session_state["project_name"] = project_name
32
  st.session_state["hub_username"] = hub_username
33
  st.session_state["hub_token"] = st.sidebar.text_input(
34
+ "Hub Token", type="password", value=os.environ.get("HF_TOKEN", None)
35
  )
36
+ if st.session_state["hub_token"] is not None:
 
 
 
37
  os.environ["HF_TOKEN"] = st.session_state["hub_token"]
38
  st.sidebar.link_button(
39
  "🤗 Get your Hub Token", "https://huggingface.co/settings/tokens"