Spaces:
Sleeping
Sleeping
Download src/api/authentification.py from leskimou/projet_MLops_part2: direct link, hf CLI and curl.
- Browser
- Download file 604 Bytes
-
https://huggingface.co/spaces/leskimou/projet_MLops_part2/resolve/main/src/api/authentification.py
- Command line
-
hf download hf://spaces/leskimou/projet_MLops_part2/src/api/authentification.py
-
curl -L -o authentification.py https://huggingface.co/spaces/leskimou/projet_MLops_part2/resolve/main/src/api/authentification.py
604 Bytes
| import streamlit as st | |
| from src.utils.auth import authenticate | |
| st.set_page_config(layout="wide") | |
| st.title("Prédiction remboursement de crédit") | |
| st.subheader("Connexion") | |
| username = st.text_input("Nom d'utilisateur") | |
| password = st.text_input("Mot de passe", type="password") | |
| if st.button("Se connecter"): | |
| if not username or not password: | |
| st.warning("Veuillez remplir tous les champs.") | |
| else: | |
| user = authenticate(username, password) | |
| if user: | |
| st.session_state.user = user | |
| st.rerun() | |
| else: | |
| st.error("Identifiants incorrects.") | |