darkc0de commited on
Commit
c86a7e2
Β·
verified Β·
1 Parent(s): f437cc9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -0
app.py CHANGED
@@ -142,11 +142,37 @@ body, .gradio-container {
142
  .gr-input { font-family: 'Orbitron', sans-serif !important; }
143
  .gr-label { font-family: 'Orbitron', sans-serif !important; }
144
  .gr-chatbot .message { font-family: 'Orbitron', sans-serif !important; }
 
 
 
 
 
 
 
 
 
145
  """
146
 
 
 
 
147
  # Create a Gradio Blocks layout for more control over the interface
148
  # Apply the dark theme and custom CSS
149
  with gr.Blocks(theme="dark", head=kofi_script, css=custom_css) as demo:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
150
  # Create the chat interface component
151
  gr.ChatInterface(
152
  fn=respond, # The function to call when a message is sent
 
142
  .gr-input { font-family: 'Orbitron', sans-serif !important; }
143
  .gr-label { font-family: 'Orbitron', sans-serif !important; }
144
  .gr-chatbot .message { font-family: 'Orbitron', sans-serif !important; }
145
+
146
+ /* Optional: Add custom CSS for the header image if you need specific styling */
147
+ .header-image {
148
+ display: block; /* Ensures the image takes its own line */
149
+ margin-left: auto; /* Centers the image */
150
+ margin-right: auto; /* Centers the image */
151
+ max-width: 100%; /* Ensures it's responsive */
152
+ height: auto; /* Maintains aspect ratio */
153
+ }
154
  """
155
 
156
+ # Define your header image URL
157
+ HEADER_IMAGE_URL = "https://cdn-uploads.huggingface.co/production/uploads/6540a02d1389943fef4d2640/92UZWGtPV_2Oa5DxIIMBR.png"
158
+
159
  # Create a Gradio Blocks layout for more control over the interface
160
  # Apply the dark theme and custom CSS
161
  with gr.Blocks(theme="dark", head=kofi_script, css=custom_css) as demo:
162
+ # Add the header image at the very top using gr.Image
163
+ gr.Image(
164
+ value=HEADER_IMAGE_URL,
165
+ label=None, # Set to None to remove the label text below the image
166
+ show_label=False, # Also hide the label
167
+ container=False, # Set to False to remove the default container styling
168
+ height="auto", # Adjust height as needed, e.g., 100, "200px", "auto"
169
+ width="100%", # Set width to fill the container
170
+ elem_classes=["header-image"] # Apply custom CSS class for centering/responsiveness
171
+ )
172
+ # You might want to add some spacing after the image if it blends too much with the chat.
173
+ # gr.Markdown("<br>") # Adds a line break for spacing
174
+
175
+
176
  # Create the chat interface component
177
  gr.ChatInterface(
178
  fn=respond, # The function to call when a message is sent