Spaces:
Runtime error
Runtime error
Commit
·
aa90afd
1
Parent(s):
0cca41e
update: intro page
Browse files- 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 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 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")
|
|
|
|
|
|
|
|
|
|
|
|