Change to hardcoded theme

#7
by STSDerek - opened
Files changed (1) hide show
  1. app.py +25 -8
app.py CHANGED
@@ -4,6 +4,21 @@ from sentence_transformers import SentenceTransformer, util
4
  # Load semantic similarity model
5
  model = SentenceTransformer('all-MiniLM-L6-v2')
6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  # SofTouch Systems FAQs
8
  faq_data = {
9
  "Who is SofTouch Systems?": "Derek Moyes founded SofTouch Systems in 1993 as a sole-proprietorship in San Antonio, Texas. Today, SofTouch Systems has an extensive list of customers, including home users, non-profits, and small & medium businesses.",
@@ -83,13 +98,15 @@ def chatbot(message, history):
83
 
84
  #iface = gr.ChatInterface(fn=chatbot, type="messages")
85
 
86
- # Wrap the ChatInterface in Blocks for CSS styling
87
- with gr.Blocks(css="style.css") as iface:
88
- gr.ChatInterface(
89
- fn=chatbot,
90
- title="VELMA - Virtual Engagement Liaison & Messaging Assistant",
91
- description="Try asking about our services, support, cybersecurity, or backups.",
92
- type="messages"
93
- )
 
 
94
 
95
  iface.launch(share=True)
 
4
  # Load semantic similarity model
5
  model = SentenceTransformer('all-MiniLM-L6-v2')
6
 
7
+ # Custom theme params (matches current website colors)
8
+ sts_theme = gr.themes.Default(
9
+ primary_hue="blue",
10
+ secondary_hue="orange",
11
+ neutral_hue="gray",
12
+ font=["Arial", "sans-serif"],
13
+ ).set(
14
+ button_primary_background_fill="#FF6B00", # Orange accent
15
+ button_primary_text_color="#FFFFFF", # White text
16
+ button_primary_background_fill_hover="#E05D00", # Darker orange
17
+ chatbot_background_color="#E9ECEF", # Light gray
18
+ border_color_primary="#0056B3", # Dark blue
19
+ color_background_primary="#0056B3", # Header blue
20
+ )
21
+
22
  # SofTouch Systems FAQs
23
  faq_data = {
24
  "Who is SofTouch Systems?": "Derek Moyes founded SofTouch Systems in 1993 as a sole-proprietorship in San Antonio, Texas. Today, SofTouch Systems has an extensive list of customers, including home users, non-profits, and small & medium businesses.",
 
98
 
99
  #iface = gr.ChatInterface(fn=chatbot, type="messages")
100
 
101
+ # Wrap the ChatInterface in Blocks for CSS styling -- CSS not working, see hardcoded theme above.
102
+ # with gr.Blocks(css="style.css") as iface:
103
+
104
+ iface = gr.ChatInterface(
105
+ fn=chatbot,
106
+ title="VELMA - Virtual Engagement Liaison & Messaging Assistant",
107
+ description="Try asking about our services, support, cybersecurity, or backups.",
108
+ type="messages",
109
+ theme=sts_theme # <-- This applies colors, hopefully.
110
+ )
111
 
112
  iface.launch(share=True)