import streamlit as st import streamlit_authenticator as stauth from worker import WorkerClassifier names = ["worker"] usernames = ["worker"] passwords = ["$2b$12$tpRRH6gyMvH39pb2xYNKFOIFDe6wf1/7bFmA6Xzn0ASjVsAnqAdpG"] authenticator = stauth.Authenticate( names, usernames, passwords, "some_cookie_name", "some_signature_key", cookie_expiry_days=30, ) name, authentication_status, username = authenticator.login("Login", "main") if authentication_status: authenticator.logout("Logout", "main") MODEL_DIR = "./models/roberta-large" worker_clf = WorkerClassifier(MODEL_DIR) worker_clf.init_models() text = st.text_input( "Worker Profile Description", "This candidate is a very warm and kind..." ) proc_input, output = worker_clf.predict(text) st.write(f"**Text used to classify worker profile:**") st.write(proc_input) st.write("**Predicted Worker Profile:**") for i, o in zip(proc_input, output): st.write(o[0]) elif authentication_status == False: st.error("Username/password is incorrect") elif authentication_status == None: st.warning("Please enter your username and password")