Spaces:
Paused
Paused
Commit
·
4d7a1f2
1
Parent(s):
d093c56
Delete files
Browse files- app.py +8 -10
- config.yaml +0 -11
app.py
CHANGED
|
@@ -1,17 +1,12 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
import streamlit_authenticator as stauth
|
| 3 |
-
import yaml
|
| 4 |
-
|
| 5 |
from utils import get_answer
|
| 6 |
|
| 7 |
-
with open('./config.yaml') as file:
|
| 8 |
-
config = yaml.load(file, Loader=stauth.SafeLoader)
|
| 9 |
-
|
| 10 |
authenticator = stauth.Authenticate(
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
)
|
| 16 |
|
| 17 |
st.title("Le risposte alle tue domande personali")
|
|
@@ -25,4 +20,7 @@ if authentication_status:
|
|
| 25 |
if input:
|
| 26 |
|
| 27 |
response = get_answer(input)
|
| 28 |
-
st.write(response)
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
import streamlit_authenticator as stauth
|
|
|
|
|
|
|
| 3 |
from utils import get_answer
|
| 4 |
|
|
|
|
|
|
|
|
|
|
| 5 |
authenticator = stauth.Authenticate(
|
| 6 |
+
eval(st.secrets["creds"]),
|
| 7 |
+
st.secrets["name"],
|
| 8 |
+
st.secrets["key"],
|
| 9 |
+
st.secrets["expiry_days"]
|
| 10 |
)
|
| 11 |
|
| 12 |
st.title("Le risposte alle tue domande personali")
|
|
|
|
| 20 |
if input:
|
| 21 |
|
| 22 |
response = get_answer(input)
|
| 23 |
+
st.write(response)
|
| 24 |
+
|
| 25 |
+
elif authentication_status == False:
|
| 26 |
+
st.error('Username/password non sono corretti.')
|
config.yaml
DELETED
|
@@ -1,11 +0,0 @@
|
|
| 1 |
-
credentials:
|
| 2 |
-
usernames:
|
| 3 |
-
giuseppe:
|
| 4 |
-
email: [email protected]
|
| 5 |
-
name: giuseppe
|
| 6 |
-
password: $2b$12$21WJTxnSoQ/yRgPz40Wwdezfwa/w0mjmWLLceNJTryzbl7Yqq8F9K
|
| 7 |
-
|
| 8 |
-
cookie:
|
| 9 |
-
expiry_days: 30
|
| 10 |
-
key: 1b9acd8d2d7d709a8be9ecbc9a3aad6d # Must be string
|
| 11 |
-
name: sonia
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|