prakharg24 commited on
Commit
562f6c3
·
verified ·
1 Parent(s): 1edfb78

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -88
app.py CHANGED
@@ -1,21 +1,5 @@
1
  import streamlit as st
2
-
3
- ############# Style Setup ##############
4
- st.markdown(
5
- """
6
- <style>
7
- .center-container {
8
- display: flex;
9
- flex-direction: column;
10
- align-items: center;
11
- text-align: center;
12
- }
13
- </style>
14
- """,
15
- unsafe_allow_html=True
16
- )
17
- ########################################
18
-
19
 
20
  # --- Configure the app ---
21
  st.set_page_config(page_title="Multiplicity Demo", layout="centered")
@@ -24,75 +8,10 @@ st.set_page_config(page_title="Multiplicity Demo", layout="centered")
24
  if "page" not in st.session_state:
25
  st.session_state.page = "landing" # can be: landing, main, sentence_X
26
 
27
- # --- Helper function to change page ---
28
- def go_to(page_name):
29
- st.session_state.page = page_name
30
- st.rerun()
31
-
32
- # -----------------------------
33
- # Landing Page
34
- # -----------------------------
35
  if st.session_state.page == "landing":
36
- st.markdown("<div class='center-container'>", unsafe_allow_html=True)
37
- st.markdown(
38
- """
39
- <div style='text-align: center; font-size:14px; color:gray;'>
40
- Welcome to the Multiplicity Interactive Demo.<br><br>
41
- In this demo, you will explore how developer decisions create a multiverse of possible models,
42
- and how these connect to concepts like arbitrariness, homogenization, and the ICA framework.<br><br>
43
- Follow the steps to see your decisions in context.
44
- </div>
45
- """,
46
- unsafe_allow_html=True
47
- )
48
- st.markdown("<br>", unsafe_allow_html=True)
49
- if st.button("Get Started"):
50
- go_to("main")
51
-
52
- st.markdown("</div>", unsafe_allow_html=True)
53
-
54
-
55
- # -----------------------------
56
- # Main Page (Clickable Sentences)
57
- # -----------------------------
58
- elif st.session_state.page == "main":
59
- st.markdown("<div class='center-container'>", unsafe_allow_html=True)
60
-
61
- st.markdown(
62
- "<div style='font-size:24px; color:#3366cc; font-weight:bold;'>Explore the concepts:</div>",
63
- unsafe_allow_html=True
64
- )
65
- st.write("")
66
-
67
- sentences = [
68
- "Multiplicity: Many models, same accuracy, different predictions.",
69
- "ICA Framework: Intentional, Conventional, and Arbitrary decisions.",
70
- "Arbitrariness: Why different models might treat individuals differently.",
71
- "Homogenization: Why similar decisions happen across many developers."
72
- ]
73
-
74
- for i, sentence in enumerate(sentences):
75
- if st.button(sentence, key=f"sentence_{i}"):
76
- go_to(f"sentence_{i}")
77
-
78
- st.markdown("</div>", unsafe_allow_html=True)
79
-
80
- # -----------------------------
81
- # Empty Sentence Pages
82
- # -----------------------------
83
- else:
84
- # Extract sentence index
85
- sentence_index = int(st.session_state.page.split("_")[1])
86
-
87
- st.markdown("<div class='center-container'>", unsafe_allow_html=True)
88
- st.markdown(
89
- f"<div style='font-size:20px; color:#cc3333; font-weight:bold;'>Page for Sentence {sentence_index + 1}</div>",
90
- unsafe_allow_html=True
91
- )
92
-
93
- st.write("This page is currently empty. You can add the content for this concept here.")
94
-
95
- if st.button("Back to Main Page"):
96
- go_to("main")
97
-
98
- st.markdown("</div>", unsafe_allow_html=True)
 
1
  import streamlit as st
2
+ from pages import landing, home, ica
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
 
4
  # --- Configure the app ---
5
  st.set_page_config(page_title="Multiplicity Demo", layout="centered")
 
8
  if "page" not in st.session_state:
9
  st.session_state.page = "landing" # can be: landing, main, sentence_X
10
 
11
+ # Routing
 
 
 
 
 
 
 
12
  if st.session_state.page == "landing":
13
+ landing.render()
14
+ elif st.session_state.page == "home":
15
+ home.render()
16
+ elif st.session_state.page == "ica":
17
+ ica.render()