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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -12
app.py CHANGED
@@ -197,25 +197,30 @@ def main():
197
  display: block;
198
  margin: 0 auto;
199
  }
 
 
 
 
 
 
 
200
  """
201
 
202
  logo_path = "Equinix-LOGO.jpeg" # Make sure this file exists or update the path
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
 
197
  display: block;
198
  margin: 0 auto;
199
  }
200
+
201
+ .logo-image {
202
+ max-height: 80px;
203
+ width: auto;
204
+ display: inline-block;
205
+ }
206
+
207
  """
208
 
209
  logo_path = "Equinix-LOGO.jpeg" # Make sure this file exists or update the path
210
 
211
  # Create Gradio UI
212
  with gr.Blocks(css=custom_css) as ui:
 
 
213
  with gr.Row(elem_id="header-container"):
214
+ with gr.Column(elem_id="logo-wrapper"):
215
+ if os.path.exists(logo_path):
216
+ # Using HTML component for more control over image rendering
217
+ gr.HTML(f'<img src="file/{logo_path}" class="logo-image" alt="Equinix Logo">')
218
+ # Debug message to console
219
+ print(f"Logo file found at {os.path.abspath(logo_path)}")
220
+ else:
221
+ gr.Markdown("<h2>Equinix</h2>")
222
+ print(f"Warning: Logo file {logo_path} not found at {os.path.abspath(logo_path)}")
223
+
224
 
225
 
226
  # Title & Description