Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -138,41 +138,33 @@ def get_topics_list() -> List[str]:
|
|
| 138 |
# Custom CSS for better UI
|
| 139 |
custom_css = """
|
| 140 |
.gradio-container {
|
| 141 |
-
max-width:
|
| 142 |
-
|
|
|
|
| 143 |
}
|
| 144 |
|
| 145 |
-
.main
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
padding: 20px;
|
| 149 |
-
background: #fafafa;
|
| 150 |
}
|
| 151 |
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
padding: 15px;
|
| 156 |
-
|
| 157 |
}
|
| 158 |
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
padding: 15px;
|
| 163 |
-
|
| 164 |
}
|
| 165 |
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
}
|
| 170 |
-
|
| 171 |
-
/* Copy button styling */
|
| 172 |
-
.copy-button {
|
| 173 |
-
background: #4CAF50 !important;
|
| 174 |
-
color: white !important;
|
| 175 |
-
border-radius: 4px !important;
|
| 176 |
}
|
| 177 |
"""
|
| 178 |
|
|
@@ -188,7 +180,7 @@ with gr.Blocks(
|
|
| 188 |
|
| 189 |
with gr.Tabs() as tabs:
|
| 190 |
# MAIN CHAT TAB
|
| 191 |
-
with gr.Tab("π¬ Chat"
|
| 192 |
# AI Response Area (Top)
|
| 193 |
ai_response = gr.Textbox(
|
| 194 |
label="π€ AI Response",
|
|
@@ -201,7 +193,7 @@ with gr.Blocks(
|
|
| 201 |
)
|
| 202 |
|
| 203 |
# Input Area (Bottom)
|
| 204 |
-
with gr.Group(
|
| 205 |
with gr.Row():
|
| 206 |
user_input = gr.Textbox(
|
| 207 |
label="βοΈ Your Message",
|
|
@@ -224,7 +216,7 @@ with gr.Blocks(
|
|
| 224 |
|
| 225 |
# HISTORY TAB
|
| 226 |
with gr.Tab("π Chat History"):
|
| 227 |
-
with gr.Group(
|
| 228 |
with gr.Row():
|
| 229 |
topic_filter = gr.Dropdown(
|
| 230 |
label="π Filter by Topic",
|
|
@@ -245,7 +237,8 @@ with gr.Blocks(
|
|
| 245 |
max_lines=30,
|
| 246 |
interactive=False,
|
| 247 |
show_copy_button=True,
|
| 248 |
-
placeholder="Chat history and summaries will appear here..."
|
|
|
|
| 249 |
)
|
| 250 |
|
| 251 |
# Event Handlers
|
|
|
|
| 138 |
# Custom CSS for better UI
|
| 139 |
custom_css = """
|
| 140 |
.gradio-container {
|
| 141 |
+
max-width: 100% !important;
|
| 142 |
+
padding: 0 !important;
|
| 143 |
+
margin: 0 !important;
|
| 144 |
}
|
| 145 |
|
| 146 |
+
.main {
|
| 147 |
+
max-width: 100% !important;
|
| 148 |
+
padding: 10px !important;
|
|
|
|
|
|
|
| 149 |
}
|
| 150 |
|
| 151 |
+
/* AI Response text spacing */
|
| 152 |
+
.response-area textarea {
|
| 153 |
+
line-height: 1.6 !important;
|
| 154 |
+
padding: 15px !important;
|
| 155 |
+
font-size: 14px !important;
|
| 156 |
}
|
| 157 |
|
| 158 |
+
/* History text spacing */
|
| 159 |
+
.history-display textarea {
|
| 160 |
+
line-height: 1.6 !important;
|
| 161 |
+
padding: 15px !important;
|
| 162 |
+
font-size: 14px !important;
|
| 163 |
}
|
| 164 |
|
| 165 |
+
/* Better text readability */
|
| 166 |
+
textarea {
|
| 167 |
+
line-height: 1.6 !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 168 |
}
|
| 169 |
"""
|
| 170 |
|
|
|
|
| 180 |
|
| 181 |
with gr.Tabs() as tabs:
|
| 182 |
# MAIN CHAT TAB
|
| 183 |
+
with gr.Tab("π¬ Chat"):
|
| 184 |
# AI Response Area (Top)
|
| 185 |
ai_response = gr.Textbox(
|
| 186 |
label="π€ AI Response",
|
|
|
|
| 193 |
)
|
| 194 |
|
| 195 |
# Input Area (Bottom)
|
| 196 |
+
with gr.Group():
|
| 197 |
with gr.Row():
|
| 198 |
user_input = gr.Textbox(
|
| 199 |
label="βοΈ Your Message",
|
|
|
|
| 216 |
|
| 217 |
# HISTORY TAB
|
| 218 |
with gr.Tab("π Chat History"):
|
| 219 |
+
with gr.Group():
|
| 220 |
with gr.Row():
|
| 221 |
topic_filter = gr.Dropdown(
|
| 222 |
label="π Filter by Topic",
|
|
|
|
| 237 |
max_lines=30,
|
| 238 |
interactive=False,
|
| 239 |
show_copy_button=True,
|
| 240 |
+
placeholder="Chat history and summaries will appear here...",
|
| 241 |
+
elem_classes="history-display"
|
| 242 |
)
|
| 243 |
|
| 244 |
# Event Handlers
|