sonIA / app.py
davidefiocco's picture
Improve UI
4d5fcf9
raw
history blame
710 Bytes
import streamlit as st
import streamlit_authenticator as stauth
import yaml
from utils import get_answer
with open('./config.yaml') as file:
config = yaml.load(file, Loader=stauth.SafeLoader)
print(st.secrets)
authenticator = stauth.Authenticate(
config['credentials'],
config['cookie']['name'],
config['cookie']['key'],
config['cookie']['expiry_days']
)
name, authentication_status, username = authenticator.login('Login', 'main')
st.title("Le risposte alle tue domande personali")
if authentication_status:
input = st.text_input("Scrivi una domanda in italiano e comparirà la risposta!")
if input:
response = get_answer(input)
st.write(response)