import streamlit as st import os # Set up the page configuration and initial display st.set_page_config( page_title="AI Explainability Demo", page_icon="🔍" ) def check_password(): """Function to verify the entered password.""" # Check if the password is already verified if 'password_verified' in st.session_state and st.session_state['password_verified']: return True # Password input field in the sidebar with a submit button with st.sidebar: password_input = st.text_input("Enter Password:", type="password") if st.button('Submit'): if password_input == os.getenv('PASSWORD'): st.session_state['password_verified'] = True st.experimental_rerun() # Rerun the app with the updated state else: st.error("Incorrect Password, please try again.") # Main app function def main(): st.title('AI Explainability in the EU AI Act: a Case for an NLE Approach Towards Pragmatic Explanations') st.sidebar.success("Select a demo above.") st.markdown(""" Welcome to the AI explainability demonstration. This application showcases how Natural Language Explanations (NLE) can be used to provide clear and understandable explanations, which are crucial under the EU AI Act. Please use the sidebar to navigate through different demonstrations once you have access. """) # Entry point for the app if __name__ == '__main__': if check_password(): main() # Load the main app if the password is verified