Upload 2 files
Browse files- app.py +117 -0
- requirements.txt +13 -0
app.py
ADDED
@@ -0,0 +1,117 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
from pages import (
|
3 |
+
chatbot, notes_generation, exam_preparation, mnemonics_generation,
|
4 |
+
study_roadmap, interview_preparation, ai_buddy, meditation,
|
5 |
+
mind_palace, sherlock_observation
|
6 |
+
)
|
7 |
+
|
8 |
+
# Custom CSS for improved styling
|
9 |
+
def local_css(file_name):
|
10 |
+
with open(file_name, "r") as f:
|
11 |
+
st.markdown(f'<style>{f.read()}</style>', unsafe_allow_html=True)
|
12 |
+
|
13 |
+
# Load custom CSS
|
14 |
+
local_css("style.css")
|
15 |
+
|
16 |
+
st.set_page_config(
|
17 |
+
page_title="S.H.E.R.L.O.C.K.",
|
18 |
+
page_icon="π΅οΈ",
|
19 |
+
layout="wide",
|
20 |
+
initial_sidebar_state="expanded"
|
21 |
+
)
|
22 |
+
|
23 |
+
# Define the pages with icons
|
24 |
+
PAGES = {
|
25 |
+
"Web RAG Powered Chatbot": {"icon": "π¬", "function": chatbot},
|
26 |
+
"Notes Generation": {"icon": "π", "function": notes_generation},
|
27 |
+
"Exam Preparation": {"icon": "π", "function": exam_preparation},
|
28 |
+
"Mnemonics Generation": {"icon": "π§ ", "function": mnemonics_generation},
|
29 |
+
"Study Roadmap": {"icon": "πΊοΈ", "function": study_roadmap},
|
30 |
+
"Interview Preparation": {"icon": "π€", "function": interview_preparation},
|
31 |
+
"AI Buddy": {"icon": "π€", "function": ai_buddy},
|
32 |
+
"Meditation & Mindfulness": {"icon": "π§", "function": meditation},
|
33 |
+
"Mind Palace Builder": {"icon": "ποΈ", "function": mind_palace},
|
34 |
+
"Sherlock Style Observation": {"icon": "π", "function": sherlock_observation}
|
35 |
+
}
|
36 |
+
|
37 |
+
def main():
|
38 |
+
st.sidebar.image("logo.png", use_column_width=True)
|
39 |
+
st.sidebar.title("S.H.E.R.L.O.C.K. π΅οΈ")
|
40 |
+
st.sidebar.markdown("*Study Helper & Educational Resource for Learning & Observational Knowledge*")
|
41 |
+
|
42 |
+
st.markdown("""
|
43 |
+
<style>
|
44 |
+
body {
|
45 |
+
font-family: 'Roboto', sans-serif;
|
46 |
+
background-color: #f0f2f6;
|
47 |
+
}
|
48 |
+
|
49 |
+
.stButton button {
|
50 |
+
background-color: #0e1117;
|
51 |
+
color: white;
|
52 |
+
border-radius: 20px;
|
53 |
+
padding: 10px 20px;
|
54 |
+
font-weight: bold;
|
55 |
+
transition: all 0.3s ease;
|
56 |
+
}
|
57 |
+
|
58 |
+
.stButton button:hover {
|
59 |
+
background-color: #2e7d32;
|
60 |
+
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
|
61 |
+
}
|
62 |
+
|
63 |
+
.sidebar .sidebar-content {
|
64 |
+
background-color: #0e1117;
|
65 |
+
color: white;
|
66 |
+
}
|
67 |
+
|
68 |
+
h1, h2, h3 {
|
69 |
+
color: #1e3a8a;
|
70 |
+
}
|
71 |
+
|
72 |
+
.stRadio > label {
|
73 |
+
font-weight: bold;
|
74 |
+
color: #333;
|
75 |
+
}
|
76 |
+
</style>
|
77 |
+
""")
|
78 |
+
|
79 |
+
selection = st.sidebar.radio(
|
80 |
+
"Navigate",
|
81 |
+
list(PAGES.keys()),
|
82 |
+
format_func=lambda x: f"{PAGES[x]['icon']} {x}"
|
83 |
+
)
|
84 |
+
|
85 |
+
st.sidebar.markdown("---")
|
86 |
+
st.sidebar.info(
|
87 |
+
"This app is part of the S.H.E.R.L.O.C.K. project. "
|
88 |
+
"For more information, visit [our website](https://example.com)."
|
89 |
+
)
|
90 |
+
st.sidebar.text("Version 1.0")
|
91 |
+
|
92 |
+
# Main content area
|
93 |
+
st.title(f"{PAGES[selection]['icon']} {selection}")
|
94 |
+
|
95 |
+
# Display a brief description of the selected feature
|
96 |
+
feature_descriptions = {
|
97 |
+
"Web RAG Powered Chatbot": "Engage with our AI-powered chatbot for interactive learning and web-based information retrieval.",
|
98 |
+
"Notes Generation": "Transform complex documents into concise, easy-to-understand notes.",
|
99 |
+
"Exam Preparation": "Generate custom question papers and practice tests to ace your exams.",
|
100 |
+
"Mnemonics Generation": "Create personalized memory aids to boost your retention of key information.",
|
101 |
+
"Study Roadmap": "Get a tailored learning path to achieve your educational goals efficiently.",
|
102 |
+
"Interview Preparation": "Simulate interview scenarios and receive feedback to improve your performance.",
|
103 |
+
"AI Buddy": "Chat with a personalized AI companion for support and therapy sessions.",
|
104 |
+
"Meditation & Mindfulness": "Access resources for relaxation, focus, and mental well-being.",
|
105 |
+
"Mind Palace Builder": "Construct mental frameworks to enhance your memory and learning capabilities.",
|
106 |
+
"Sherlock Style Observation": "Develop critical thinking skills and learn to approach subjects from unique perspectives."
|
107 |
+
}
|
108 |
+
|
109 |
+
st.markdown(f"*{feature_descriptions[selection]}*")
|
110 |
+
st.markdown("---")
|
111 |
+
|
112 |
+
# Load the selected page
|
113 |
+
with st.spinner(f"Loading {selection} ..."):
|
114 |
+
PAGES[selection]["function"].main()
|
115 |
+
|
116 |
+
if __name__ == "__main__":
|
117 |
+
main()
|
requirements.txt
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
streamlit==1.22.0
|
2 |
+
openai==1.3.0
|
3 |
+
python-dotenv==1.0.0
|
4 |
+
transformers==4.29.2
|
5 |
+
torch==1.13.1
|
6 |
+
sentence-transformers==2.2.2
|
7 |
+
networkx==2.8.4
|
8 |
+
scikit-learn==1.2.2
|
9 |
+
PyPDF2==3.0.1
|
10 |
+
python-docx==0.8.11
|
11 |
+
SpeechRecognition==3.10.0
|
12 |
+
gTTS==2.3.1
|
13 |
+
Pillow==9.5.0
|