theRealNG commited on
Commit
a4d4feb
·
unverified ·
2 Parent(s): c3f26b294686a0

Merge pull request #22 from beautiful-code/ui/images

Browse files
beautiful_code_logo.jpeg ADDED
ui/article_recommendation.py CHANGED
@@ -18,6 +18,23 @@ def icon(emoji: str):
18
 
19
 
20
  def main():
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  icon("📖 Articles RecommendAIgent")
22
  st.subheader("Let AI agents recommend articles based on your interest!")
23
 
 
18
 
19
 
20
  def main():
21
+ page_bg_img = '''
22
+ <style>
23
+ [data-testid="stAppViewContainer"]{
24
+ background-image:url("https://www.shutterstock.com/image-vector/abstract-technology-communication-concept-vector-600nw-1914443275.jpg");
25
+ background-size:cover;
26
+ }
27
+ [data-testid="stHeader"]{
28
+ background: rgba(0,0,0,0);
29
+ }
30
+ [data-testid="stToolbar"]{
31
+ right: 2rem;
32
+ }
33
+
34
+
35
+ </style>
36
+ '''
37
+ st.markdown(page_bg_img, unsafe_allow_html=True)
38
  icon("📖 Articles RecommendAIgent")
39
  st.subheader("Let AI agents recommend articles based on your interest!")
40
 
ui/course_lessons_extractor.py CHANGED
@@ -18,6 +18,23 @@ def setup_event_loop():
18
  asyncio.set_event_loop(None)
19
 
20
  def main():
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  st.markdown("<div class='container'>", unsafe_allow_html=True)
22
 
23
  st.markdown(
 
18
  asyncio.set_event_loop(None)
19
 
20
  def main():
21
+ page_bg_img = '''
22
+ <style>
23
+ [data-testid="stAppViewContainer"]{
24
+ background-image:url("https://www.shutterstock.com/image-vector/abstract-technology-communication-concept-vector-600nw-1914443275.jpg");
25
+ background-size:cover;
26
+ }
27
+ [data-testid="stHeader"]{
28
+ background: rgba(0,0,0,0);
29
+ }
30
+ [data-testid="stToolbar"]{
31
+ right: 2rem;
32
+ }
33
+
34
+
35
+ </style>
36
+ '''
37
+ st.markdown(page_bg_img, unsafe_allow_html=True)
38
  st.markdown("<div class='container'>", unsafe_allow_html=True)
39
 
40
  st.markdown(
ui/main.css CHANGED
@@ -1,10 +1,4 @@
1
- body {
2
- background-color: white;
3
- color: #333;
4
- font-family: 'Arial', sans-serif;
5
- margin: 0;
6
- padding: 0;
7
- }
8
  .main-title {
9
  font-size: 3em;
10
  font-weight: bold;
@@ -18,24 +12,5 @@ body {
18
  text-align: center;
19
  color: #333;
20
  }
21
- /* .card {
22
- background-color: #f8f9fa;
23
- border-radius: 10px;
24
- padding: 20px;
25
- margin: 20px;
26
- height:300px;
27
- box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
28
- display: flex;
29
- flex-direction: column;
30
- justify-content: center;
31
- align-items: center;
32
- text-align: center;
33
- }
34
- .card h2 {
35
- font-size: 1.5em;
36
- color: #007bff;
37
- }
38
- .card p {
39
- color: #666;
40
- } */
41
 
 
1
+
 
 
 
 
 
 
2
  .main-title {
3
  font-size: 3em;
4
  font-weight: bold;
 
12
  text-align: center;
13
  color: #333;
14
  }
15
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
 
ui/research_paper.py CHANGED
@@ -9,11 +9,11 @@ def main():
9
  st.markdown(
10
  """
11
  <style>
12
- .main {
13
- background-color: #f5f5f5;
14
- padding: 20px;
15
- border-radius: 10px;
16
- }
17
  .centered {
18
  display: flex;
19
  flex-direction: column;
@@ -68,6 +68,16 @@ def main():
68
  .element li b {
69
  font-size: 22px;
70
  }
 
 
 
 
 
 
 
 
 
 
71
 
72
  </style>
73
  """,
 
9
  st.markdown(
10
  """
11
  <style>
12
+ # .main {
13
+ # background-color: #f5f5f5;
14
+ # padding: 20px;
15
+ # border-radius: 10px;
16
+ # }
17
  .centered {
18
  display: flex;
19
  flex-direction: column;
 
68
  .element li b {
69
  font-size: 22px;
70
  }
71
+ [data-testid="stAppViewContainer"]{
72
+ background-image:url("https://www.shutterstock.com/image-vector/abstract-technology-communication-concept-vector-600nw-1914443275.jpg");
73
+ background-size:cover;
74
+ }
75
+ [data-testid="stHeader"]{
76
+ background: rgba(0,0,0,0);
77
+ }
78
+ [data-testid="stToolbar"]{
79
+ right: 2rem;
80
+ }
81
 
82
  </style>
83
  """,
ui/til_feedback.py CHANGED
@@ -6,7 +6,26 @@ from langsmith import Client
6
  from workflows.utils.feedback import Feedback
7
 
8
  load_dotenv()
9
- def main():
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  st.markdown("<div class='container'>", unsafe_allow_html=True)
11
 
12
  st.markdown(
@@ -18,14 +37,6 @@ def main():
18
  """,
19
  unsafe_allow_html=True
20
  )
21
- # til_content = st.text_area('Enter what you learnt today:',
22
- # "* Quantization is the process of reducing the size of LLM models by reducing the underlying weights.\n"
23
- # "* The weights are reduced by scaling down the datatypes from a datatype that takes larger space to a data type that takes a smaller space, this is also known as downcasting.\n"
24
- # "* Quantization offers benefits such as reduced storage space usage and faster computation.\n"
25
- # "* Disadvantages: Answers are less precise\n"
26
- # "* I learnt how to use Go Routines to handle concurrency in React.\n",
27
- # key='til_content', help='Enter what you learnt today')
28
-
29
 
30
  default_content = (
31
  "* Quantization is the process of reducing the size of LLM models by reducing the underlying weights.\n"
@@ -115,5 +126,4 @@ def clear_feedback_state(results):
115
  st.session_state[key] = False
116
 
117
  if __name__ == "__main__":
118
- main()
119
-
 
6
  from workflows.utils.feedback import Feedback
7
 
8
  load_dotenv()
9
+ def feedback_main():
10
+
11
+ page_bg_img = '''
12
+ <style>
13
+ [data-testid="stAppViewContainer"]{
14
+ background-image:url("https://www.shutterstock.com/image-vector/abstract-technology-communication-concept-vector-600nw-1914443275.jpg");
15
+ background-size:cover;
16
+ }
17
+ [data-testid="stHeader"]{
18
+ background: rgba(0,0,0,0);
19
+ }
20
+ [data-testid="stToolbar"]{
21
+ right: 2rem;
22
+ }
23
+
24
+
25
+ </style>
26
+ '''
27
+
28
+ st.markdown(page_bg_img, unsafe_allow_html=True)
29
  st.markdown("<div class='container'>", unsafe_allow_html=True)
30
 
31
  st.markdown(
 
37
  """,
38
  unsafe_allow_html=True
39
  )
 
 
 
 
 
 
 
 
40
 
41
  default_content = (
42
  "* Quantization is the process of reducing the size of LLM models by reducing the underlying weights.\n"
 
126
  st.session_state[key] = False
127
 
128
  if __name__ == "__main__":
129
+ feedback_main()
 
ui_main.py CHANGED
@@ -3,18 +3,16 @@ from streamlit_extras.stylable_container import stylable_container
3
  from ui.article_recommendation import main as article_recommendor_main
4
  from ui.course_lessons_extractor import main as lessons_extractor_main
5
  from ui.research_paper import main as research_article_suggester_main
6
- from ui.til_feedback import main as feedback_main
7
  import math
8
  import streamlit as st
9
  import subprocess
10
 
11
  load_dotenv()
12
 
13
- # Running required system commands
14
  subprocess.run(["playwright", "install", "chromium"])
15
 
16
 
17
- st.set_page_config(page_title='Growthy AI Workflows', page_icon='📰', layout='wide')
18
 
19
  def load_css(file_name):
20
  with open(file_name) as f:
@@ -37,57 +35,100 @@ def main():
37
  lessons_extractor_main()
38
 
39
  def show_main_page():
40
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  css = load_css("ui/main.css")
 
42
  st.markdown(f"<style>{css}</style>", unsafe_allow_html=True)
43
 
44
  st.markdown('<div class="main-title">Welcome to Growthy AI Workflows!</div>', unsafe_allow_html=True)
45
  st.markdown("---")
46
- st.markdown('<div class="sub-header">Navigate to Specific Workflow:</div>', unsafe_allow_html=True)
47
 
48
  card_info = [
49
- {"title": "TIL Feedback", "description": "Provide your valuable feedback.", "key": "feedback"},
50
- {"title": "Course Lesson Extractor", "description": "Extract lessons for a given course", "key": "lessons_extractor"},
51
- {"title": "Article Recommender", "description": "Discover articles tailored to your interests.", "key": "article_recommendor"},
52
- {"title": "Recent Article Suggester", "description": "Get suggestions for recent research articles.", "key": "research_article_suggester"},
53
  ]
54
 
55
  num_cols = 3
56
  num_rows = math.ceil(len(card_info) / num_cols)
57
 
58
-
59
- for row in range(num_rows):
60
- cols = st.columns(num_cols)
61
- for col in range(num_cols):
62
- index = row * num_cols + col
63
- if index < len(card_info):
64
- card = card_info[index]
65
- with cols[col]:
66
- with stylable_container(
67
- key="inside_container_with_border",
68
- css_styles="""
69
- {
70
- background-color: #f8f9fa;
71
- border-radius: 10px;
72
- box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.1);
73
- display: flex;
74
- flex-wrap: wrap;
75
- flex-direction: column;
76
- justify-content: center;
77
- align-items: center;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
78
  padding:10px;
79
- margin:10px;
80
- """,
81
- ):
82
- st.markdown(
83
- f'''
84
- <div class="card">
85
- <h2>{card["title"]}</h2>
86
- <p>{card["description"]}</p>
87
- </div>
88
- ''', unsafe_allow_html=True)
89
- if st.button(f"Go to {card['title']}", key=card["key"]):
90
- st.session_state.page = card["key"]
91
-
 
92
  if __name__ == '__main__':
93
  main()
 
3
  from ui.article_recommendation import main as article_recommendor_main
4
  from ui.course_lessons_extractor import main as lessons_extractor_main
5
  from ui.research_paper import main as research_article_suggester_main
6
+ from ui.til_feedback import feedback_main
7
  import math
8
  import streamlit as st
9
  import subprocess
10
 
11
  load_dotenv()
12
 
 
13
  subprocess.run(["playwright", "install", "chromium"])
14
 
15
 
 
16
 
17
  def load_css(file_name):
18
  with open(file_name) as f:
 
35
  lessons_extractor_main()
36
 
37
  def show_main_page():
38
+ st.set_page_config(page_title='Growthy AI Workflows', page_icon='📰',layout="wide")
39
+ page_bg_img = '''
40
+ <style>
41
+ [data-testid="stAppViewContainer"]{
42
+ background-image:url("https://www.shutterstock.com/image-vector/abstract-technology-communication-concept-vector-600nw-1914443275.jpg");
43
+ background-size:cover;
44
+ }
45
+ [data-testid="stHeader"]{
46
+ background: rgba(0,0,0,0);
47
+ }
48
+ [data-testid="stToolbar"]{
49
+ right: 2rem;
50
+ }
51
+
52
+
53
+ </style>
54
+ '''
55
+ st.markdown(page_bg_img, unsafe_allow_html=True)
56
+
57
  css = load_css("ui/main.css")
58
+
59
  st.markdown(f"<style>{css}</style>", unsafe_allow_html=True)
60
 
61
  st.markdown('<div class="main-title">Welcome to Growthy AI Workflows!</div>', unsafe_allow_html=True)
62
  st.markdown("---")
 
63
 
64
  card_info = [
65
+ {"title": "TIL Feedback", "description": "Provide your valuable feedback.", "key": "feedback","image":"https://agent.ai/icons/search.svg"},
66
+ {"title": "Course Lesson Extractor", "description": "Extract lessons for a given course", "key": "lessons_extractor","image":"https://agent.ai/icons/business-analyst.svg"},
67
+ {"title": "Article Recommender", "description": "Discover articles tailored to your interests.", "key": "article_recommendor","image":"https://agent.ai/icons/robot.svg"},
68
+ {"title": "Recent Article Suggester", "description": "Get suggestions for recent research articles.", "key": "research_article_suggester","image":"https://agent.ai/icons/data.svg"},
69
  ]
70
 
71
  num_cols = 3
72
  num_rows = math.ceil(len(card_info) / num_cols)
73
 
74
+ col1, col2, col3 = st.columns([2,6,2])
75
+
76
+ with col2:
77
+ for row in range(num_rows):
78
+ cols = st.columns(num_cols)
79
+ for col in range(num_cols):
80
+ index = row * num_cols + col
81
+ if index < len(card_info):
82
+ card = card_info[index]
83
+ with cols[col]:
84
+ with stylable_container(
85
+ key="inside_container_with_border",
86
+ css_styles="""
87
+ {
88
+ background-color: #e9eaec;
89
+ border-radius: 10px;
90
+ box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.1);
91
+ padding:10px;
92
+ display: flex;
93
+ flex-direction: row;
94
+ flex-wrap: wrap;
95
+ align-items: center;
96
+ justify-content: center;
97
+ height:1000px;
98
+ border: 1px solid #C0C0C0;
99
+
100
+ } """,
101
+ ):
102
+ with st.container():
103
+ st.image(card["image"])
104
+ st.markdown(
105
+ f"""
106
+ <div style=" display: flex; flex-wrap:wrap; flex-direction: column; text-align: center; justify-content: center; align-items: center">
107
+ <span style="font-weight:900; font-size: 24px;"> {card["title"]}</span>
108
+ <p class="styled-description">{card["description"]}</p>
109
+ </div>
110
+ """, unsafe_allow_html=True
111
+ )
112
+ if st.button("Explore", key=card["key"]):
113
+ st.session_state.page = card["key"]
114
+ st.markdown(
115
+ """
116
+ <style>
117
+ [data-testid="stImage"] img {
118
  padding:10px;
119
+ height: 100px;
120
+ width: 100px;
121
+ border-radius: 50%;
122
+ border: 2px solid white;
123
+
124
+ }
125
+ [data-testid="column"] {
126
+ text-align: center;
127
+ }
128
+
129
+ </style>
130
+ """, unsafe_allow_html=True
131
+ )
132
+
133
  if __name__ == '__main__':
134
  main()