Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -29,29 +29,40 @@ client = Groq(api_key=os.getenv("GROQ_API_KEY"))
|
|
| 29 |
# Initialize HuggingFace embeddings for FAISS
|
| 30 |
embeddings = HuggingFaceEmbeddings(model_name="sentence-transformers/all-MiniLM-L6-v2")
|
| 31 |
|
| 32 |
-
# Custom CSS with Silver, Blue, and Gold Theme + Responsiveness
|
| 33 |
st.markdown("""
|
| 34 |
<style>
|
| 35 |
:root {
|
| 36 |
-
--silver: #D8D8D8;
|
|
|
|
| 37 |
--blue: #5C89BC;
|
|
|
|
|
|
|
| 38 |
--gold: #A87E01;
|
| 39 |
--text-color: #333333;
|
|
|
|
|
|
|
| 40 |
}
|
| 41 |
.stApp {
|
| 42 |
-
background
|
| 43 |
font-family: 'Inter', sans-serif;
|
| 44 |
max-width: 900px;
|
| 45 |
margin: 0 auto;
|
| 46 |
padding: 10px;
|
|
|
|
| 47 |
}
|
| 48 |
.header {
|
| 49 |
-
background
|
| 50 |
color: white;
|
| 51 |
-
padding:
|
| 52 |
-
border-radius:
|
| 53 |
-
box-shadow: 0
|
| 54 |
text-align: center;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
}
|
| 56 |
.header-title {
|
| 57 |
font-size: 1.5rem;
|
|
@@ -60,38 +71,57 @@ st.markdown("""
|
|
| 60 |
}
|
| 61 |
.header-subtitle {
|
| 62 |
font-size: 0.9rem;
|
| 63 |
-
margin-top:
|
|
|
|
| 64 |
}
|
| 65 |
.sidebar .sidebar-content {
|
| 66 |
background-color: white;
|
| 67 |
-
border-radius:
|
| 68 |
-
box-shadow: 0
|
| 69 |
-
padding:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
}
|
| 71 |
.chat-container {
|
| 72 |
background-color: white;
|
| 73 |
-
border-radius:
|
| 74 |
-
box-shadow: 0
|
| 75 |
-
padding:
|
| 76 |
-
margin-top:
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
}
|
| 78 |
.user-message {
|
| 79 |
-
background
|
| 80 |
color: white;
|
| 81 |
-
border-radius:
|
| 82 |
-
padding:
|
| 83 |
margin-left: auto;
|
| 84 |
max-width: 80%;
|
| 85 |
-
margin-bottom:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 86 |
}
|
| 87 |
.bot-message {
|
| 88 |
background-color: #F0F0F0;
|
| 89 |
color: var(--text-color);
|
| 90 |
-
border-radius:
|
| 91 |
-
padding:
|
| 92 |
margin-right: auto;
|
| 93 |
max-width: 80%;
|
| 94 |
-
margin-bottom:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 95 |
}
|
| 96 |
.footer {
|
| 97 |
text-align: center;
|
|
@@ -112,17 +142,23 @@ st.markdown("""
|
|
| 112 |
color: var(--blue);
|
| 113 |
border-bottom: 2px solid var(--gold);
|
| 114 |
padding-bottom: 5px;
|
|
|
|
|
|
|
| 115 |
}
|
| 116 |
.stButton > button {
|
| 117 |
background-color: var(--gold);
|
| 118 |
color: white;
|
| 119 |
-
border-radius:
|
| 120 |
-
padding:
|
| 121 |
border: none;
|
| 122 |
-
box-shadow: 0
|
|
|
|
|
|
|
| 123 |
}
|
| 124 |
.stButton > button:hover {
|
| 125 |
background-color: #8C6B01;
|
|
|
|
|
|
|
| 126 |
}
|
| 127 |
@media (max-width: 768px) {
|
| 128 |
.header-title {
|
|
@@ -144,7 +180,7 @@ st.markdown("""
|
|
| 144 |
</style>
|
| 145 |
""", unsafe_allow_html=True)
|
| 146 |
|
| 147 |
-
# Helper Functions
|
| 148 |
def enhance_section_title(title):
|
| 149 |
st.markdown(f"<h2 style='border-bottom: 2px solid var(--gold); padding-bottom: 5px; color: var(--blue);'>{title}</h2>", unsafe_allow_html=True)
|
| 150 |
|
|
|
|
| 29 |
# Initialize HuggingFace embeddings for FAISS
|
| 30 |
embeddings = HuggingFaceEmbeddings(model_name="sentence-transformers/all-MiniLM-L6-v2")
|
| 31 |
|
| 32 |
+
# Custom CSS with Modernized Silver, Blue, and Gold Theme + Responsiveness
|
| 33 |
st.markdown("""
|
| 34 |
<style>
|
| 35 |
:root {
|
| 36 |
+
--silver-light: #D8D8D8;
|
| 37 |
+
--silver-dark: #B8B8B8;
|
| 38 |
--blue: #5C89BC;
|
| 39 |
+
--blue-dark: #4E73A0;
|
| 40 |
+
--blue-light: #6EA8E0;
|
| 41 |
--gold: #A87E01;
|
| 42 |
--text-color: #333333;
|
| 43 |
+
--shadow-color: rgba(0,0,0,0.1);
|
| 44 |
+
--shadow-color-stronger: rgba(0,0,0,0.2);
|
| 45 |
}
|
| 46 |
.stApp {
|
| 47 |
+
background: linear-gradient(135deg, var(--silver-light) 0%, var(--silver-dark) 100%);
|
| 48 |
font-family: 'Inter', sans-serif;
|
| 49 |
max-width: 900px;
|
| 50 |
margin: 0 auto;
|
| 51 |
padding: 10px;
|
| 52 |
+
transition: all 0.3s ease;
|
| 53 |
}
|
| 54 |
.header {
|
| 55 |
+
background: linear-gradient(90deg, var(--blue) 80%, var(--blue-dark) 100%);
|
| 56 |
color: white;
|
| 57 |
+
padding: 20px;
|
| 58 |
+
border-radius: 16px 16px 0 0;
|
| 59 |
+
box-shadow: 0 4px 12px var(--shadow-color);
|
| 60 |
text-align: center;
|
| 61 |
+
transition: transform 0.2s ease;
|
| 62 |
+
}
|
| 63 |
+
.header:hover {
|
| 64 |
+
transform: translateY(-2px);
|
| 65 |
+
box-shadow: 0 4px 12px var(--shadow-color-stronger);
|
| 66 |
}
|
| 67 |
.header-title {
|
| 68 |
font-size: 1.5rem;
|
|
|
|
| 71 |
}
|
| 72 |
.header-subtitle {
|
| 73 |
font-size: 0.9rem;
|
| 74 |
+
margin-top: 8px;
|
| 75 |
+
opacity: 0.9;
|
| 76 |
}
|
| 77 |
.sidebar .sidebar-content {
|
| 78 |
background-color: white;
|
| 79 |
+
border-radius: 16px;
|
| 80 |
+
box-shadow: 0 6px 16px var(--shadow-color);
|
| 81 |
+
padding: 20px;
|
| 82 |
+
transition: box-shadow 0.3s ease;
|
| 83 |
+
}
|
| 84 |
+
.sidebar .sidebar-content:hover {
|
| 85 |
+
box-shadow: 0 8px 20px var(--shadow-color-stronger);
|
| 86 |
}
|
| 87 |
.chat-container {
|
| 88 |
background-color: white;
|
| 89 |
+
border-radius: 16px;
|
| 90 |
+
box-shadow: 0 6px 16px var(--shadow-color);
|
| 91 |
+
padding: 20px;
|
| 92 |
+
margin-top: 25px;
|
| 93 |
+
transition: box-shadow 0.3s ease;
|
| 94 |
+
}
|
| 95 |
+
.chat-container:hover {
|
| 96 |
+
box-shadow: 0 8px 20px var(--shadow-color-stronger);
|
| 97 |
}
|
| 98 |
.user-message {
|
| 99 |
+
background: linear-gradient(45deg, var(--blue), var(--blue-light));
|
| 100 |
color: white;
|
| 101 |
+
border-radius: 20px 20px 6px 20px;
|
| 102 |
+
padding: 14px 18px;
|
| 103 |
margin-left: auto;
|
| 104 |
max-width: 80%;
|
| 105 |
+
margin-bottom: 12px;
|
| 106 |
+
box-shadow: 0 2px 8px var(--blue-dark);
|
| 107 |
+
transition: transform 0.2s ease;
|
| 108 |
+
}
|
| 109 |
+
.user-message:hover {
|
| 110 |
+
transform: scale(1.02);
|
| 111 |
}
|
| 112 |
.bot-message {
|
| 113 |
background-color: #F0F0F0;
|
| 114 |
color: var(--text-color);
|
| 115 |
+
border-radius: 20px 20px 20px 6px;
|
| 116 |
+
padding: 14px 18px;
|
| 117 |
margin-right: auto;
|
| 118 |
max-width: 80%;
|
| 119 |
+
margin-bottom: 12px;
|
| 120 |
+
box-shadow: 0 2px 8px var(--shadow-color);
|
| 121 |
+
transition: transform 0.2s ease;
|
| 122 |
+
}
|
| 123 |
+
.bot-message:hover {
|
| 124 |
+
transform: scale(1.02);
|
| 125 |
}
|
| 126 |
.footer {
|
| 127 |
text-align: center;
|
|
|
|
| 142 |
color: var(--blue);
|
| 143 |
border-bottom: 2px solid var(--gold);
|
| 144 |
padding-bottom: 5px;
|
| 145 |
+
font-size: 1.5rem;
|
| 146 |
+
font-weight: 700;
|
| 147 |
}
|
| 148 |
.stButton > button {
|
| 149 |
background-color: var(--gold);
|
| 150 |
color: white;
|
| 151 |
+
border-radius: 12px;
|
| 152 |
+
padding: 10px 20px;
|
| 153 |
border: none;
|
| 154 |
+
box-shadow: 0 4px 12px var(--shadow-color);
|
| 155 |
+
font-weight: 600;
|
| 156 |
+
transition: all 0.3s ease;
|
| 157 |
}
|
| 158 |
.stButton > button:hover {
|
| 159 |
background-color: #8C6B01;
|
| 160 |
+
transform: translateY(-2px);
|
| 161 |
+
box-shadow: 0 6px 16px var(--shadow-color-stronger);
|
| 162 |
}
|
| 163 |
@media (max-width: 768px) {
|
| 164 |
.header-title {
|
|
|
|
| 180 |
</style>
|
| 181 |
""", unsafe_allow_html=True)
|
| 182 |
|
| 183 |
+
# Helper Functions
|
| 184 |
def enhance_section_title(title):
|
| 185 |
st.markdown(f"<h2 style='border-bottom: 2px solid var(--gold); padding-bottom: 5px; color: var(--blue);'>{title}</h2>", unsafe_allow_html=True)
|
| 186 |
|