chandralegend commited on
Commit
c7545c0
·
1 Parent(s): 65f3e28

added template

Browse files
.sessions/.gitkeep ADDED
File without changes
0_Introduction.py ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import os
3
+ from utils import levels
4
+
5
+ LEVEL=0
6
+
7
+ st.header("AI Eye Tutorial Template")
8
+ st.subheader("Level 0: Introduction")
9
+
10
+ st.write("""Welcome to the AI Eye Tutorial Template! This template is designed to help you create your own AI Eye tutorial.
11
+ The template is divided into levels, and each level has a set of tasks that you need to complete before you can move on to the next level.
12
+ You can use this template to create your own tutorial by completing the tasks in each level and adding your own content. You can also use
13
+ this template to learn how to use AI Eye by completing the tasks in each level.""")
14
+
15
+ st.info(f"Current Level: {levels.get_level()}")
16
+
17
+ if st.button("Complete"):
18
+ levels.complete_level(LEVEL)
README.md CHANGED
@@ -5,7 +5,7 @@ colorFrom: green
5
  colorTo: purple
6
  sdk: streamlit
7
  sdk_version: 1.21.0
8
- app_file: app.py
9
  pinned: false
10
  license: openrail
11
  ---
 
5
  colorTo: purple
6
  sdk: streamlit
7
  sdk_version: 1.21.0
8
+ app_file: 0_Introduction.py
9
  pinned: false
10
  license: openrail
11
  ---
pages/1_Step_1.py ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from utils.levels import complete_level, render_page
3
+ LEVEL = 1
4
+
5
+ def step1_page():
6
+ st.header("Step 1")
7
+ st.subheader("Level 1: Introduction")
8
+ st.write("This is the first step of the tutorial. You can add your own content here.")
9
+
10
+ if st.button("Complete"):
11
+ complete_level(LEVEL)
12
+
13
+ render_page(step1_page, LEVEL)
pages/2_Step_2.py ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from utils.levels import complete_level, render_page
3
+ LEVEL = 2
4
+
5
+ def step2_page():
6
+ st.header("Step 2")
7
+ st.subheader("Level 2: Introduction")
8
+ st.write("This is the second step of the tutorial. You can add your own content here.")
9
+
10
+ if st.button("Complete"):
11
+ complete_level(LEVEL)
12
+
13
+ render_page(step2_page, LEVEL)
pages/3_Congratulations.py ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from utils.levels import complete_level, render_page
3
+ LEVEL = 3
4
+
5
+ def step1_page():
6
+ st.header("Congratulations!")
7
+ st.subheader("You have completed the tutorial!")
8
+ st.write("You can now use this template to create your own tutorial.")
9
+
10
+ render_page(step1_page, LEVEL)
requirements.txt ADDED
File without changes
utils/__init__.py ADDED
File without changes
utils/__pycache__/__init__.cpython-310.pyc ADDED
Binary file (161 Bytes). View file
 
utils/__pycache__/levels.cpython-310.pyc ADDED
Binary file (919 Bytes). View file
 
utils/levels.py ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+
3
+ if 'level' not in st.session_state:
4
+ st.session_state['level'] = 0
5
+
6
+ def get_level():
7
+ return st.session_state['level']
8
+
9
+ def render_page(page, level):
10
+ if st.session_state['level'] < level:
11
+ st.error(f"You need to complete Level {st.session_state['level']} first!")
12
+ else:
13
+ page()
14
+
15
+ def complete_level(level):
16
+ if st.session_state['level'] > level:
17
+ st.info(f'You have Already completed Level {level}!')
18
+ else:
19
+ st.session_state['level'] = level + 1
20
+ st.balloons()
21
+ st.success(f'You have completed Level {level}! You can now move on to the next level.')