geekyrakshit commited on
Commit
aa90afd
1 Parent(s): 0cca41e

update: intro page

Browse files
Files changed (1) hide show
  1. application_pages/intro_page.py +25 -29
application_pages/intro_page.py CHANGED
@@ -23,32 +23,28 @@ st.write(
23
  "Guardrails-Genie is a tool that helps you implement guardrails in your LLM applications."
24
  )
25
 
26
- with st.expander("Login to Your WandB Account", expanded=True):
27
- st.markdown(
28
- "Get your Wandb API key from [https://wandb.ai/authorize](https://wandb.ai/authorize)"
29
- )
30
- weave_entity_name = st.text_input(
31
- "Weave Entity Name", value=st.session_state.weave_entity_name
32
- )
33
- st.session_state.weave_entity_name = weave_entity_name
34
- weave_project_name = st.text_input(
35
- "Weave Project Name", value=st.session_state.weave_project_name
36
- )
37
- st.session_state.weave_project_name = weave_project_name
38
- wandb_api_key = st.text_input("Wandb API Key", value="", type="password")
39
- st.session_state.wandb_api_key = wandb_api_key
40
- authenticate_button = st.button("Authenticate")
41
- st.session_state.authenticate_button = authenticate_button
42
-
43
- if authenticate_button and (
44
- st.session_state.wandb_api_key != ""
45
- and st.session_state.weave_project_name != ""
46
- ):
47
- is_wandb_logged_in = wandb.login(
48
- key=st.session_state.wandb_api_key, relogin=True
49
- )
50
- if is_wandb_logged_in:
51
- st.session_state.is_authenticated = True
52
- st.success("Logged in to Wandb")
53
- else:
54
- st.error("Failed to log in to Wandb")
 
23
  "Guardrails-Genie is a tool that helps you implement guardrails in your LLM applications."
24
  )
25
 
26
+ st.sidebar.markdown(
27
+ "Get your Wandb API key from [https://wandb.ai/authorize](https://wandb.ai/authorize)"
28
+ )
29
+ weave_entity_name = st.sidebar.text_input(
30
+ "Weave Entity Name", value=st.session_state.weave_entity_name
31
+ )
32
+ st.session_state.weave_entity_name = weave_entity_name
33
+ weave_project_name = st.sidebar.text_input(
34
+ "Weave Project Name", value=st.session_state.weave_project_name
35
+ )
36
+ st.session_state.weave_project_name = weave_project_name
37
+ wandb_api_key = st.sidebar.text_input("Wandb API Key", value="", type="password")
38
+ st.session_state.wandb_api_key = wandb_api_key
39
+ authenticate_button = st.sidebar.button("Authenticate")
40
+ st.session_state.authenticate_button = authenticate_button
41
+
42
+ if authenticate_button and (
43
+ st.session_state.wandb_api_key != "" and st.session_state.weave_project_name != ""
44
+ ):
45
+ is_wandb_logged_in = wandb.login(key=st.session_state.wandb_api_key, relogin=True)
46
+ if is_wandb_logged_in:
47
+ st.session_state.is_authenticated = True
48
+ st.success("Logged in to Wandb")
49
+ else:
50
+ st.error("Failed to log in to Wandb")