-
Notifications
You must be signed in to change notification settings - Fork 1
/
app.py
30 lines (27 loc) · 845 Bytes
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
"""Main Module"""
import streamlit as st
import src.pages.Home
import src.pages.AttrGrad
import src.pages.AttrAttention
import src.pages.AttrAdditionalExps
PAGES = {
"Home": src.pages.Home,
"[Attribution] Gradient": src.pages.AttrGrad,
"[Attribution] Attention": src.pages.AttrAttention,
"[Attribution] Additional Experiments": src.pages.AttrAdditionalExps
}
def main():
"""Main function of the App"""
st.set_page_config(
page_title="Demo for XAI",
page_icon=":face_with_monocle:",
layout="centered", # "wide",
# initial_sidebar_state="collapsed"
)
st.sidebar.title("Navigation")
selection = st.sidebar.radio("Go to", list(PAGES.keys()))
page = PAGES[selection]
with st.spinner(f"Loading {selection} ..."):
page.write()
if __name__ == "__main__":
main()