Spaces:
Sleeping
Sleeping
Update UI for full-width display on big screens with responsive design
Browse files- gradio_app.py +23 -7
gradio_app.py
CHANGED
|
@@ -148,26 +148,42 @@ model_thread.start()
|
|
| 148 |
# Custom CSS for ChatGPT-like appearance
|
| 149 |
css = """
|
| 150 |
.gradio-container {
|
| 151 |
-
max-width:
|
| 152 |
-
margin:
|
| 153 |
}
|
| 154 |
#chatbot {
|
| 155 |
-
height: 600px !important;
|
| 156 |
overflow-y: auto !important;
|
| 157 |
}
|
| 158 |
.message {
|
| 159 |
-
padding:
|
| 160 |
margin: 5px 0 !important;
|
| 161 |
-
border-radius:
|
| 162 |
}
|
| 163 |
.user {
|
| 164 |
background-color: #dcf8c6 !important;
|
| 165 |
-
margin-left:
|
| 166 |
}
|
| 167 |
.bot {
|
| 168 |
background-color: #f1f1f1 !important;
|
| 169 |
-
margin-right:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 170 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 171 |
"""
|
| 172 |
|
| 173 |
# Create Gradio interface
|
|
|
|
| 148 |
# Custom CSS for ChatGPT-like appearance
|
| 149 |
css = """
|
| 150 |
.gradio-container {
|
| 151 |
+
max-width: 100%; width: 100% !important;
|
| 152 |
+
margin: 0; padding: 20px !important;
|
| 153 |
}
|
| 154 |
#chatbot {
|
| 155 |
+
height: 70vh; min-height: 600px !important;
|
| 156 |
overflow-y: auto !important;
|
| 157 |
}
|
| 158 |
.message {
|
| 159 |
+
padding: 12px 16px !important;
|
| 160 |
margin: 5px 0 !important;
|
| 161 |
+
border-radius: 12px; max-width: 85%; word-wrap: break-word !important;
|
| 162 |
}
|
| 163 |
.user {
|
| 164 |
background-color: #dcf8c6 !important;
|
| 165 |
+
margin-left: auto; margin-right: 0 !important;
|
| 166 |
}
|
| 167 |
.bot {
|
| 168 |
background-color: #f1f1f1 !important;
|
| 169 |
+
margin-left: 0; margin-right: auto !important;
|
| 170 |
+
}/* Responsive design for larger screens */
|
| 171 |
+
@media (min-width: 1400px) {
|
| 172 |
+
.gradio-container {
|
| 173 |
+
padding: 40px !important;
|
| 174 |
+
}
|
| 175 |
+
#chatbot {
|
| 176 |
+
height: 75vh !important;
|
| 177 |
+
}
|
| 178 |
}
|
| 179 |
+
@media (min-width: 1800px) {
|
| 180 |
+
.gradio-container {
|
| 181 |
+
padding: 60px !important;
|
| 182 |
+
}
|
| 183 |
+
#chatbot {
|
| 184 |
+
height: 80vh !important;
|
| 185 |
+
}
|
| 186 |
+
}}
|
| 187 |
"""
|
| 188 |
|
| 189 |
# Create Gradio interface
|