sonIA / app.py
davidefiocco's picture
Use black and logging
feabab6
raw
history blame
662 Bytes
import streamlit as st
import streamlit_authenticator as stauth
from utils import get_answer
authenticator = stauth.Authenticate(
eval(st.secrets["creds"]),
st.secrets["name"],
st.secrets["key"],
int(st.secrets["expiry_days"]),
)
st.title("Le risposte alle tue domande personali")
name, authentication_status, username = authenticator.login("Login", "main")
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)
elif authentication_status == False:
st.error("Username/password non sono corretti.")