Spaces:
Runtime error
Runtime error
shravya commited on
Commit ·
353f348
1
Parent(s): 01c715d
added images to cards and background home page
Browse files- beautiful_code_logo.jpeg +0 -0
- ui/main.css +2 -27
- ui/til_feedback.py +2 -11
- ui_main.py +80 -43
beautiful_code_logo.jpeg
ADDED
|
ui/main.css
CHANGED
|
@@ -1,10 +1,4 @@
|
|
| 1 |
-
|
| 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 |
-
|
| 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/til_feedback.py
CHANGED
|
@@ -6,7 +6,7 @@ from langsmith import Client
|
|
| 6 |
from workflows.utils.feedback import Feedback
|
| 7 |
|
| 8 |
load_dotenv()
|
| 9 |
-
def
|
| 10 |
st.markdown("<div class='container'>", unsafe_allow_html=True)
|
| 11 |
|
| 12 |
st.markdown(
|
|
@@ -18,14 +18,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 +107,4 @@ def clear_feedback_state(results):
|
|
| 115 |
st.session_state[key] = False
|
| 116 |
|
| 117 |
if __name__ == "__main__":
|
| 118 |
-
|
| 119 |
-
|
|
|
|
| 6 |
from workflows.utils.feedback import Feedback
|
| 7 |
|
| 8 |
load_dotenv()
|
| 9 |
+
def feedback_main():
|
| 10 |
st.markdown("<div class='container'>", unsafe_allow_html=True)
|
| 11 |
|
| 12 |
st.markdown(
|
|
|
|
| 18 |
""",
|
| 19 |
unsafe_allow_html=True
|
| 20 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
default_content = (
|
| 23 |
"* Quantization is the process of reducing the size of LLM models by reducing the underlying weights.\n"
|
|
|
|
| 107 |
st.session_state[key] = False
|
| 108 |
|
| 109 |
if __name__ == "__main__":
|
| 110 |
+
feedback_main()
|
|
|
ui_main.py
CHANGED
|
@@ -3,19 +3,15 @@ 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
|
| 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:
|
| 21 |
return f.read()
|
|
@@ -37,8 +33,26 @@ 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)
|
|
@@ -46,48 +60,71 @@ def show_main_page():
|
|
| 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 |
-
|
| 60 |
-
|
| 61 |
-
for
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
padding:10px;
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 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 |
def load_css(file_name):
|
| 16 |
with open(file_name) as f:
|
| 17 |
return f.read()
|
|
|
|
| 33 |
lessons_extractor_main()
|
| 34 |
|
| 35 |
def show_main_page():
|
| 36 |
+
st.set_page_config(page_title='Growthy AI Workflows', page_icon='📰',layout="wide")
|
| 37 |
+
page_bg_img = '''
|
| 38 |
+
<style>
|
| 39 |
+
[data-testid="stAppViewContainer"]{
|
| 40 |
+
background-image:url("https://www.shutterstock.com/image-vector/abstract-technology-communication-concept-vector-600nw-1914443275.jpg");
|
| 41 |
+
background-size:cover;
|
| 42 |
+
}
|
| 43 |
+
[data-testid="stHeader"]{
|
| 44 |
+
background: rgba(0,0,0,0);
|
| 45 |
+
}
|
| 46 |
+
[data-testid="stToolbar"]{
|
| 47 |
+
right: 2rem;
|
| 48 |
+
}
|
| 49 |
+
</style>
|
| 50 |
+
'''
|
| 51 |
+
|
| 52 |
+
st.markdown(page_bg_img, unsafe_allow_html=True)
|
| 53 |
+
|
| 54 |
css = load_css("ui/main.css")
|
| 55 |
+
|
| 56 |
st.markdown(f"<style>{css}</style>", unsafe_allow_html=True)
|
| 57 |
|
| 58 |
st.markdown('<div class="main-title">Welcome to Growthy AI Workflows!</div>', unsafe_allow_html=True)
|
|
|
|
| 60 |
st.markdown('<div class="sub-header">Navigate to Specific Workflow:</div>', unsafe_allow_html=True)
|
| 61 |
|
| 62 |
card_info = [
|
| 63 |
+
{"title": "TIL Feedback", "description": "Provide your valuable feedback.", "key": "feedback","image":"https://agent.ai/icons/search.svg"},
|
| 64 |
+
{"title": "Course Lesson Extractor", "description": "Extract lessons for a given course", "key": "lessons_extractor","image":"https://agent.ai/icons/business-analyst.svg"},
|
| 65 |
+
{"title": "Article Recommender", "description": "Discover articles tailored to your interests.", "key": "article_recommendor","image":"https://agent.ai/icons/robot.svg"},
|
| 66 |
+
{"title": "Recent Article Suggester", "description": "Get suggestions for recent research articles.", "key": "research_article_suggester","image":"https://agent.ai/icons/data.svg"},
|
| 67 |
]
|
| 68 |
|
| 69 |
num_cols = 3
|
| 70 |
num_rows = math.ceil(len(card_info) / num_cols)
|
| 71 |
|
| 72 |
+
col1, col2, col3 = st.columns([2,6,2])
|
| 73 |
+
|
| 74 |
+
with col2:
|
| 75 |
+
for row in range(num_rows):
|
| 76 |
+
cols = st.columns(num_cols)
|
| 77 |
+
for col in range(num_cols):
|
| 78 |
+
index = row * num_cols + col
|
| 79 |
+
if index < len(card_info):
|
| 80 |
+
card = card_info[index]
|
| 81 |
+
with cols[col]:
|
| 82 |
+
with stylable_container(
|
| 83 |
+
key="inside_container_with_border",
|
| 84 |
+
css_styles="""
|
| 85 |
+
{
|
| 86 |
+
background-color: #e9eaec;
|
| 87 |
+
border-radius: 10px;
|
| 88 |
+
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.1);
|
| 89 |
+
padding:10px;
|
| 90 |
+
display: flex;
|
| 91 |
+
flex-direction: row;
|
| 92 |
+
flex-wrap: wrap;
|
| 93 |
+
align-items: center;
|
| 94 |
+
justify-content: center;
|
| 95 |
+
|
| 96 |
+
} """,
|
| 97 |
+
):
|
| 98 |
+
with st.container():
|
| 99 |
+
st.image(card["image"])
|
| 100 |
+
st.markdown(
|
| 101 |
+
f"""
|
| 102 |
+
<div style=" display: flex; flex-direction: column; text-align: center; justify-content: center; align-items: center">
|
| 103 |
+
<span style="font-weight:900; font-size: 24px;"> {card["title"]}</span>
|
| 104 |
+
<p class="styled-description">{card["description"]}</p>
|
| 105 |
+
</div>
|
| 106 |
+
""", unsafe_allow_html=True
|
| 107 |
+
)
|
| 108 |
+
if st.button(f"Go to {card['title']}", key=card["key"]):
|
| 109 |
+
st.session_state.page = card["key"]
|
| 110 |
+
st.markdown(
|
| 111 |
+
"""
|
| 112 |
+
<style>
|
| 113 |
+
[data-testid="stImage"] img {
|
| 114 |
padding:10px;
|
| 115 |
+
height: 100px;
|
| 116 |
+
width: 100px;
|
| 117 |
+
border-radius: 50%;
|
| 118 |
+
border: 2px solid white;
|
| 119 |
+
|
| 120 |
+
}
|
| 121 |
+
[data-testid="column"] {
|
| 122 |
+
text-align: center;
|
| 123 |
+
}
|
| 124 |
+
|
| 125 |
+
</style>
|
| 126 |
+
""", unsafe_allow_html=True
|
| 127 |
+
)
|
| 128 |
+
|
| 129 |
if __name__ == '__main__':
|
| 130 |
main()
|