SAVAI123 commited on
Commit
4e030c1
·
verified ·
1 Parent(s): bcbdb3a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +29 -18
app.py CHANGED
@@ -177,22 +177,25 @@ def main():
177
  print("Initializing retriever...")
178
  retriever = initialize_retriever()
179
 
180
- # Custom CSS for styling
 
 
181
  custom_css = """
182
- .gradio-container {
183
- background-color: #f0f0f0;
184
- text-align: center;
 
 
 
185
  }
186
- #logo img {
 
 
 
 
 
187
  display: block;
188
  margin: 0 auto;
189
- max-width: 200px;
190
- }
191
- .datetime-display {
192
- text-align: center;
193
- margin-bottom: 20px;
194
- font-size: 18px;
195
- font-weight: bold;
196
  }
197
  """
198
 
@@ -200,12 +203,20 @@ def main():
200
 
201
  # Create Gradio UI
202
  with gr.Blocks(css=custom_css) as ui:
203
- # Check if logo exists before trying to display it
204
- if os.path.exists(logo_path):
205
- gr.Image(logo_path, elem_id="logo", show_label=False, height=100, width=200)
206
- else:
207
- gr.Markdown("<h2 style='text-align: center;'>Equinix</h2>")
208
- print(f"Warning: Logo file {logo_path} not found")
 
 
 
 
 
 
 
 
209
 
210
  # Title & Description
211
  gr.Markdown("<h1 style='text-align: center; color: black;'>Equinix Chatbot for Automation Team</h1>")
 
177
  print("Initializing retriever...")
178
  retriever = initialize_retriever()
179
 
180
+
181
+
182
+ # Define custom CSS to style the logo across the entire header
183
  custom_css = """
184
+ {
185
+ width: 100%;
186
+ background-color: #fff;
187
+ padding: 10px 0;
188
+ margin-bottom: 20px;
189
+ box-shadow: 0 2px 5px rgba(0,0,0,0.1);
190
  }
191
+
192
+ #logo-image {
193
+ width: 100%;
194
+ height: auto;
195
+ max-height: 80px;
196
+ object-fit: contain;
197
  display: block;
198
  margin: 0 auto;
 
 
 
 
 
 
 
199
  }
200
  """
201
 
 
203
 
204
  # Create Gradio UI
205
  with gr.Blocks(css=custom_css) as ui:
206
+
207
+ # Create a header container first
208
+ with gr.Row(elem_id="header-container"):
209
+ # Check if logo exists before trying to display it
210
+ if os.path.exists(logo_path):
211
+ gr.Image(logo_path, elem_id="logo-image", show_label=False)
212
+ else:
213
+ gr.Markdown("<h2 style='text-align: center; width: 100%;'>Equinix</h2>")
214
+ print(f"Warning: Logo file {logo_path} not found")
215
+
216
+ # The rest of your UI components go here
217
+ with gr.Row():
218
+ gr.Markdown("## Your application content goes here")
219
+
220
 
221
  # Title & Description
222
  gr.Markdown("<h1 style='text-align: center; color: black;'>Equinix Chatbot for Automation Team</h1>")