Spaces:
Running
Running
geekyrakshit
commited on
Commit
·
0a25b7c
1
Parent(s):
f7b114e
add: openai api key input in application pages
Browse files- README.md +0 -5
- application_pages/intro_page.py +5 -0
README.md
CHANGED
@@ -18,11 +18,6 @@ source .venv/bin/activate
|
|
18 |
## Run the App
|
19 |
|
20 |
```bash
|
21 |
-
export OPENAI_API_KEY="YOUR_OPENAI_API_KEY"
|
22 |
-
export WEAVE_PROJECT="YOUR_WEAVE_PROJECT"
|
23 |
-
export WANDB_PROJECT_NAME="YOUR_WANDB_PROJECT_NAME"
|
24 |
-
export WANDB_ENTITY_NAME="YOUR_WANDB_ENTITY_NAME"
|
25 |
-
export WANDB_LOG_MODEL="checkpoint"
|
26 |
streamlit run app.py
|
27 |
```
|
28 |
|
|
|
18 |
## Run the App
|
19 |
|
20 |
```bash
|
|
|
|
|
|
|
|
|
|
|
21 |
streamlit run app.py
|
22 |
```
|
23 |
|
application_pages/intro_page.py
CHANGED
@@ -1,3 +1,5 @@
|
|
|
|
|
|
1 |
import streamlit as st
|
2 |
|
3 |
import wandb
|
@@ -39,6 +41,9 @@ 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 |
):
|
|
|
1 |
+
import os
|
2 |
+
|
3 |
import streamlit as st
|
4 |
|
5 |
import wandb
|
|
|
41 |
authenticate_button = st.sidebar.button("Authenticate")
|
42 |
st.session_state.authenticate_button = authenticate_button
|
43 |
|
44 |
+
openai_api_key = st.sidebar.text_input("OpenAI API Key", value="", type="password")
|
45 |
+
os.environ["OPENAI_API_KEY"] = openai_api_key
|
46 |
+
|
47 |
if authenticate_button and (
|
48 |
st.session_state.wandb_api_key != "" and st.session_state.weave_project_name != ""
|
49 |
):
|