Spaces:
Runtime error
Runtime error
shravya commited on
Commit ·
94686a0
1
Parent(s): 353f348
added background to all pages and few changes to ui-home
Browse files- ui/article_recommendation.py +17 -0
- ui/course_lessons_extractor.py +17 -0
- ui/research_paper.py +15 -5
- ui/til_feedback.py +19 -0
- ui_main.py +10 -6
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/research_paper.py
CHANGED
|
@@ -9,11 +9,11 @@ def main():
|
|
| 9 |
st.markdown(
|
| 10 |
"""
|
| 11 |
<style>
|
| 12 |
-
.main {
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 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
|
@@ -7,6 +7,25 @@ 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(
|
|
|
|
| 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(
|
ui_main.py
CHANGED
|
@@ -12,6 +12,8 @@ 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()
|
|
@@ -46,9 +48,10 @@ def show_main_page():
|
|
| 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")
|
|
@@ -57,7 +60,6 @@ def show_main_page():
|
|
| 57 |
|
| 58 |
st.markdown('<div class="main-title">Welcome to Growthy AI Workflows!</div>', unsafe_allow_html=True)
|
| 59 |
st.markdown("---")
|
| 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"},
|
|
@@ -92,6 +94,8 @@ def show_main_page():
|
|
| 92 |
flex-wrap: wrap;
|
| 93 |
align-items: center;
|
| 94 |
justify-content: center;
|
|
|
|
|
|
|
| 95 |
|
| 96 |
} """,
|
| 97 |
):
|
|
@@ -99,15 +103,15 @@ def show_main_page():
|
|
| 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(
|
| 109 |
st.session_state.page = card["key"]
|
| 110 |
-
|
| 111 |
"""
|
| 112 |
<style>
|
| 113 |
[data-testid="stImage"] img {
|
|
@@ -120,7 +124,7 @@ def show_main_page():
|
|
| 120 |
}
|
| 121 |
[data-testid="column"] {
|
| 122 |
text-align: center;
|
| 123 |
-
}
|
| 124 |
|
| 125 |
</style>
|
| 126 |
""", unsafe_allow_html=True
|
|
|
|
| 12 |
|
| 13 |
subprocess.run(["playwright", "install", "chromium"])
|
| 14 |
|
| 15 |
+
|
| 16 |
+
|
| 17 |
def load_css(file_name):
|
| 18 |
with open(file_name) as f:
|
| 19 |
return f.read()
|
|
|
|
| 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")
|
|
|
|
| 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"},
|
|
|
|
| 94 |
flex-wrap: wrap;
|
| 95 |
align-items: center;
|
| 96 |
justify-content: center;
|
| 97 |
+
height:1000px;
|
| 98 |
+
border: 1px solid #C0C0C0;
|
| 99 |
|
| 100 |
} """,
|
| 101 |
):
|
|
|
|
| 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 {
|
|
|
|
| 124 |
}
|
| 125 |
[data-testid="column"] {
|
| 126 |
text-align: center;
|
| 127 |
+
}
|
| 128 |
|
| 129 |
</style>
|
| 130 |
""", unsafe_allow_html=True
|