Spaces:
Runtime error
Runtime error
Yew Chong
commited on
Commit
•
e7fd01f
1
Parent(s):
4d990d2
force make secrets.toml
Browse files- streamlit/app8.py +8 -0
streamlit/app8.py
CHANGED
@@ -37,6 +37,14 @@ import os, dotenv
|
|
37 |
from dotenv import load_dotenv
|
38 |
load_dotenv()
|
39 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
|
41 |
## Load from streamlit!!
|
42 |
os.environ["HF_TOKEN"] = os.environ.get("HF_TOKEN") or st.secrets["HF_TOKEN"]
|
|
|
37 |
from dotenv import load_dotenv
|
38 |
load_dotenv()
|
39 |
|
40 |
+
if not os.path.isdir("../.streamlit"):
|
41 |
+
os.mkdir("../.streamlit")
|
42 |
+
print('made streamlit folder')
|
43 |
+
if not os.path.isfile("../.streamlit/secrets.toml"):
|
44 |
+
with open("../.streamlit/secrets.toml", "w") as f:
|
45 |
+
f.write(os.environ.get("STREAMLIT_SECRETS"))
|
46 |
+
print('made new file')
|
47 |
+
|
48 |
|
49 |
## Load from streamlit!!
|
50 |
os.environ["HF_TOKEN"] = os.environ.get("HF_TOKEN") or st.secrets["HF_TOKEN"]
|