abdull4h commited on
Commit
42e6b36
·
verified ·
1 Parent(s): f76da15

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -25
app.py CHANGED
@@ -326,18 +326,6 @@ Question: {query} [/INST]</s>"""
326
  self.conversation_history = []
327
  return "Conversation has been reset."
328
 
329
- # Main function with Gradio UI
330
- import os
331
- import re
332
- import json
333
- import time
334
- from tqdm import tqdm
335
- from pathlib import Path
336
- import spaces
337
- import gradio as gr
338
-
339
- # WARNING: Don't import torch, cuda, or GPU-related modules at the top level
340
- # All previous helper functions and classes remain the same
341
 
342
  def main():
343
  # Create the Vision 2030 service
@@ -377,16 +365,23 @@ def main():
377
  .chat-input { background-color: white; border-radius: 8px; border: 1px solid #ddd; }
378
  .info-box { background-color: #f8f9fa; padding: 10px; border-radius: 8px; margin-top: 10px; }
379
  """) as demo:
380
- # Header with logo and title
381
  with gr.Row():
382
- with gr.Column(scale=1):
383
- gr.Image("https://www.vision2030.gov.sa/media/g0dp5h3t/vision-2030-logo-en.png",
384
- show_label=False, container=False, height=100,
385
- elem_classes=["header-img"])
386
- with gr.Column(scale=3):
387
- gr.Markdown("""
388
- # Vision 2030 Assistant
389
- ### Your interactive guide to Saudi Arabia's national transformation program
 
 
 
 
 
 
 
390
  """)
391
 
392
  # Language toggle in the header
@@ -408,10 +403,6 @@ def main():
408
  chatbot = gr.Chatbot(
409
  height=450,
410
  bubble_full_width=False,
411
- avatar_images=(
412
- "https://api.iconify.design/fluent-emoji:person.svg",
413
- "https://api.iconify.design/fluent-emoji:robot.svg"
414
- ),
415
  show_label=False
416
  )
417
 
 
326
  self.conversation_history = []
327
  return "Conversation has been reset."
328
 
 
 
 
 
 
 
 
 
 
 
 
 
329
 
330
  def main():
331
  # Create the Vision 2030 service
 
365
  .chat-input { background-color: white; border-radius: 8px; border: 1px solid #ddd; }
366
  .info-box { background-color: #f8f9fa; padding: 10px; border-radius: 8px; margin-top: 10px; }
367
  """) as demo:
368
+ # Header with stylized title (no external images)
369
  with gr.Row():
370
+ with gr.Column():
371
+ gr.HTML("""
372
+ <div style="display: flex; align-items: center; margin-bottom: 20px;">
373
+ <div style="background: linear-gradient(135deg, #1e9e5a, #45b08c);
374
+ color: white; padding: 15px; border-radius: 10px;
375
+ margin-right: 20px; width: 80px; height: 80px;
376
+ display: flex; justify-content: center; align-items: center;
377
+ font-weight: bold; font-size: 24px;">
378
+ V2030
379
+ </div>
380
+ <div>
381
+ <h1 style="margin: 0; color: #1e9e5a;">Vision 2030 Assistant</h1>
382
+ <h3 style="margin: 5px 0 0 0; font-weight: normal;">Your interactive guide to Saudi Arabia's national transformation program</h3>
383
+ </div>
384
+ </div>
385
  """)
386
 
387
  # Language toggle in the header
 
403
  chatbot = gr.Chatbot(
404
  height=450,
405
  bubble_full_width=False,
 
 
 
 
406
  show_label=False
407
  )
408