Update tokens.md
Browse files
tokens.md
CHANGED
@@ -47,13 +47,14 @@ OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
|
|
47 |
MONGO_URI = os.getenv("MONGO_URI")
|
48 |
```
|
49 |
|
50 |
-
## Alternative
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
|
|
57 |
```
|
58 |
|
59 |
## Security Best Practices
|
|
|
47 |
MONGO_URI = os.getenv("MONGO_URI")
|
48 |
```
|
49 |
|
50 |
+
## Alternative Method
|
51 |
+
```python
|
52 |
+
import streamlit as st
|
53 |
+
|
54 |
+
# Load environment variable(s)
|
55 |
+
HUGGINGFACEHUB_API_TOKEN = st.secrets["HUGGINGFACEHUB_API_TOKEN"]
|
56 |
+
OPENAI_API_KEY = st.secrets["OPENAI_API_KEY"]
|
57 |
+
MONGO_URI = st.secrets["MONGO_URI"]
|
58 |
```
|
59 |
|
60 |
## Security Best Practices
|