Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
import streamlit as st
|
2 |
import time
|
|
|
3 |
|
4 |
# Define the list of themes and nodes
|
5 |
themes = {
|
@@ -10,26 +11,26 @@ themes = {
|
|
10 |
# Define emojis for top 1 through 10
|
11 |
emojis = ["1️⃣", "2️⃣", "3️⃣", "4️⃣", "5️⃣", "6️⃣", "7️⃣", "8️⃣", "9️⃣", "🔟"]
|
12 |
|
13 |
-
def spinning_model(theme, nodes, emojis
|
14 |
-
|
15 |
-
|
16 |
-
output
|
17 |
-
|
18 |
-
if i == index:
|
19 |
-
output += f"{emojis[i]} {node}\n"
|
20 |
-
else:
|
21 |
-
output += f"{node}\n"
|
22 |
-
|
23 |
st.markdown(f"### {theme}\n{output}")
|
24 |
st.write("---")
|
|
|
|
|
|
|
|
|
|
|
25 |
time.sleep(1)
|
26 |
-
|
27 |
-
|
28 |
|
29 |
st.title("Spinning Model Visualization")
|
30 |
st.write("Select a theme to display the spinning model.")
|
31 |
|
32 |
selected_theme = st.selectbox("Theme:", list(themes.keys()))
|
33 |
|
34 |
-
|
35 |
-
|
|
|
1 |
import streamlit as st
|
2 |
import time
|
3 |
+
import random
|
4 |
|
5 |
# Define the list of themes and nodes
|
6 |
themes = {
|
|
|
11 |
# Define emojis for top 1 through 10
|
12 |
emojis = ["1️⃣", "2️⃣", "3️⃣", "4️⃣", "5️⃣", "6️⃣", "7️⃣", "8️⃣", "9️⃣", "🔟"]
|
13 |
|
14 |
+
def spinning_model(theme, nodes, emojis):
|
15 |
+
output = ""
|
16 |
+
for i, node in enumerate(nodes):
|
17 |
+
output += f"{emojis[i]} {node}\n"
|
18 |
+
time.sleep(0.1)
|
|
|
|
|
|
|
|
|
|
|
19 |
st.markdown(f"### {theme}\n{output}")
|
20 |
st.write("---")
|
21 |
+
|
22 |
+
def random_timer():
|
23 |
+
countdown = 5
|
24 |
+
while countdown > 0:
|
25 |
+
st.write(f"Countdown: {countdown} seconds")
|
26 |
time.sleep(1)
|
27 |
+
countdown -= 1
|
28 |
+
st.experimental_rerun()
|
29 |
|
30 |
st.title("Spinning Model Visualization")
|
31 |
st.write("Select a theme to display the spinning model.")
|
32 |
|
33 |
selected_theme = st.selectbox("Theme:", list(themes.keys()))
|
34 |
|
35 |
+
spinning_model(selected_theme, themes[selected_theme], emojis)
|
36 |
+
random_timer()
|