Ahambrahmasmi commited on
Commit
3fe0fba
Β·
verified Β·
1 Parent(s): d8eea69

Update scripts/main.py

Browse files
Files changed (1) hide show
  1. scripts/main.py +62 -117
scripts/main.py CHANGED
@@ -73,26 +73,18 @@ def chat_response(message, history):
73
  except:
74
  return "Contact 4AT: +1 703 665 4255 | info@consult-4at.com"
75
 
76
- # ULTRA CLEAN CSS - NO BLUE BOXES!
77
- ultra_clean_css = """
78
- /* Reset everything */
79
- * {
80
- margin: 0 !important;
81
- padding: 0 !important;
82
- box-sizing: border-box !important;
83
- }
84
-
85
  /* Clean container */
86
  .gradio-container {
87
  background: #1a1a1a !important;
88
  color: #ffffff !important;
89
  font-family: system-ui, -apple-system, sans-serif !important;
90
- padding: 15px !important;
91
- min-height: 100vh !important;
92
  }
93
 
94
  /* Clean title */
95
- .gradio-container h1 {
96
  color: #ffffff !important;
97
  font-size: 24px !important;
98
  text-align: center !important;
@@ -101,192 +93,145 @@ ultra_clean_css = """
101
  }
102
 
103
  /* Clean description */
104
- .gradio-container p {
105
  color: #cccccc !important;
106
  text-align: center !important;
107
  font-size: 14px !important;
108
  margin: 0 0 20px 0 !important;
109
  }
110
 
111
- /* CLEAN CHAT CONTAINER - NO BULK */
112
- .chatbot, .chat-interface {
113
  background: #2a2a2a !important;
114
  border: 1px solid #404040 !important;
115
- border-radius: 8px !important;
116
- max-width: 600px !important;
117
  margin: 0 auto !important;
118
- padding: 0 !important;
119
  min-height: 400px !important;
120
  }
121
 
122
- /* SMALL CLEAN MESSAGES - NO BIG BLUE BOXES */
123
  .message {
124
- background: transparent !important;
125
- border: none !important;
126
- padding: 6px 10px !important;
127
- margin: 3px 8px !important;
128
- border-radius: 12px !important;
129
  font-size: 14px !important;
130
- line-height: 1.3 !important;
131
- max-width: 70% !important;
132
- word-wrap: break-word !important;
133
  }
134
 
135
- /* Clean user message - small and neat */
136
  .message.user {
137
  background: #0066cc !important;
138
  color: white !important;
139
  margin-left: auto !important;
140
- margin-right: 8px !important;
141
- text-align: right !important;
142
  }
143
 
144
- /* Clean bot message - small and neat */
145
  .message.bot {
146
  background: #404040 !important;
147
  color: #ffffff !important;
148
  margin-right: auto !important;
149
- margin-left: 8px !important;
150
- }
151
-
152
- /* Clean input area */
153
- .input-container {
154
- background: #2a2a2a !important;
155
- border-top: 1px solid #404040 !important;
156
- padding: 10px !important;
157
  }
158
 
 
159
  textarea {
160
  background: #404040 !important;
161
  border: 1px solid #606060 !important;
162
  color: #ffffff !important;
163
- border-radius: 20px !important;
164
- padding: 8px 15px !important;
165
  font-size: 14px !important;
166
- resize: none !important;
167
- font-family: inherit !important;
168
  }
169
 
170
  textarea::placeholder {
171
  color: #888888 !important;
172
  }
173
 
174
- textarea:focus {
175
- outline: none !important;
176
- border-color: #0066cc !important;
177
- }
178
-
179
- /* Clean send button */
180
  button {
181
  background: #0066cc !important;
182
  border: none !important;
183
  color: white !important;
184
  border-radius: 50% !important;
185
- width: 35px !important;
186
- height: 35px !important;
187
- display: flex !important;
188
- align-items: center !important;
189
- justify-content: center !important;
190
- cursor: pointer !important;
191
  }
192
 
193
- button:hover {
194
- background: #0052a3 !important;
195
- }
196
-
197
- /* CLEAN EXAMPLES - NO BIG BOXES */
198
  .examples {
199
- display: flex !important;
200
- flex-wrap: wrap !important;
201
- gap: 6px !important;
202
- padding: 10px !important;
203
- justify-content: center !important;
204
  }
205
 
206
  .example {
207
- background: #404040 !important;
208
- color: #ffffff !important;
209
- padding: 4px 8px !important;
210
- border-radius: 12px !important;
211
- font-size: 12px !important;
212
- cursor: pointer !important;
213
- border: none !important;
214
- transition: background 0.2s !important;
215
  }
216
 
217
- .example:hover {
218
- background: #0066cc !important;
219
  }
220
 
221
- /* Hide all unnecessary elements */
222
- .retry-btn, .undo-btn, .clear-btn, .share-btn, .duplicate-btn {
 
 
223
  display: none !important;
 
 
 
 
224
  }
225
 
226
- /* Clean footer */
227
- .footer {
228
- text-align: center !important;
229
- margin: 15px auto 0 auto !important;
230
- max-width: 600px !important;
231
- padding: 10px !important;
232
- color: #888888 !important;
233
- font-size: 12px !important;
234
  }
235
 
236
  /* Mobile responsive */
237
  @media (max-width: 768px) {
238
- .gradio-container {
239
- padding: 10px !important;
240
- }
241
-
242
  .chatbot {
243
- margin: 0 !important;
244
  max-width: 100% !important;
 
245
  }
246
 
247
  .message {
248
  max-width: 85% !important;
249
- font-size: 13px !important;
250
  }
251
  }
252
 
253
- /* Remove gradio branding */
254
- .gradio-container footer {
255
- display: none !important;
256
- }
257
-
258
- /* Smooth scrolling */
259
- .chatbot {
260
- scroll-behavior: smooth !important;
261
- }
262
-
263
- /* Remove extra margins from gradio */
264
- .gradio-container > div {
265
- gap: 10px !important;
266
  }
267
 
268
- .gradio-container .block {
269
- border: none !important;
270
- background: transparent !important;
 
271
  }
272
  """
273
 
274
- # Create ultra clean interface
275
  demo = gr.ChatInterface(
276
  fn=chat_response,
277
  title="4AT Professional Assistant",
278
  description="Expert AI for Accounting, Audit, Advisory & Technology Services",
279
- examples=[
280
- "test",
281
- "What is 4AT?",
282
- "Who founded 4AT?",
283
- "What services do you offer?",
284
- "Who are your clients?",
285
- "How to contact 4AT?"
286
- ],
287
- css=ultra_clean_css,
288
  theme=gr.themes.Base()
289
  )
290
 
 
 
 
 
 
 
 
 
291
  if __name__ == "__main__":
292
  demo.launch(debug=False)
 
73
  except:
74
  return "Contact 4AT: +1 703 665 4255 | info@consult-4at.com"
75
 
76
+ # ULTRA CLEAN CSS - REMOVE ALL BLUE BOXES!
77
+ clean_no_boxes_css = """
 
 
 
 
 
 
 
78
  /* Clean container */
79
  .gradio-container {
80
  background: #1a1a1a !important;
81
  color: #ffffff !important;
82
  font-family: system-ui, -apple-system, sans-serif !important;
83
+ padding: 20px !important;
 
84
  }
85
 
86
  /* Clean title */
87
+ h1 {
88
  color: #ffffff !important;
89
  font-size: 24px !important;
90
  text-align: center !important;
 
93
  }
94
 
95
  /* Clean description */
96
+ p {
97
  color: #cccccc !important;
98
  text-align: center !important;
99
  font-size: 14px !important;
100
  margin: 0 0 20px 0 !important;
101
  }
102
 
103
+ /* CLEAN CHAT CONTAINER */
104
+ .chatbot {
105
  background: #2a2a2a !important;
106
  border: 1px solid #404040 !important;
107
+ border-radius: 10px !important;
108
+ max-width: 700px !important;
109
  margin: 0 auto !important;
 
110
  min-height: 400px !important;
111
  }
112
 
113
+ /* SMALL CLEAN MESSAGES */
114
  .message {
115
+ padding: 8px 12px !important;
116
+ margin: 5px 10px !important;
117
+ border-radius: 15px !important;
 
 
118
  font-size: 14px !important;
119
+ line-height: 1.4 !important;
120
+ max-width: 75% !important;
 
121
  }
122
 
123
+ /* User message */
124
  .message.user {
125
  background: #0066cc !important;
126
  color: white !important;
127
  margin-left: auto !important;
128
+ margin-right: 10px !important;
 
129
  }
130
 
131
+ /* Bot message */
132
  .message.bot {
133
  background: #404040 !important;
134
  color: #ffffff !important;
135
  margin-right: auto !important;
136
+ margin-left: 10px !important;
 
 
 
 
 
 
 
137
  }
138
 
139
+ /* Clean input */
140
  textarea {
141
  background: #404040 !important;
142
  border: 1px solid #606060 !important;
143
  color: #ffffff !important;
144
+ border-radius: 25px !important;
145
+ padding: 10px 15px !important;
146
  font-size: 14px !important;
 
 
147
  }
148
 
149
  textarea::placeholder {
150
  color: #888888 !important;
151
  }
152
 
153
+ /* Send button */
 
 
 
 
 
154
  button {
155
  background: #0066cc !important;
156
  border: none !important;
157
  color: white !important;
158
  border-radius: 50% !important;
159
+ width: 40px !important;
160
+ height: 40px !important;
 
 
 
 
161
  }
162
 
163
+ /* HIDE ALL EXAMPLE BOXES - NO MORE BLUE BOXES! */
 
 
 
 
164
  .examples {
165
+ display: none !important;
 
 
 
 
166
  }
167
 
168
  .example {
169
+ display: none !important;
 
 
 
 
 
 
 
170
  }
171
 
172
+ .examples-container {
173
+ display: none !important;
174
  }
175
 
176
+ /* Hide example buttons completely */
177
+ .chatbot .examples,
178
+ .chat-interface .examples,
179
+ [class*="example"] {
180
  display: none !important;
181
+ visibility: hidden !important;
182
+ height: 0 !important;
183
+ width: 0 !important;
184
+ overflow: hidden !important;
185
  }
186
 
187
+ /* Hide all unnecessary buttons */
188
+ .retry-btn, .undo-btn, .clear-btn, .share-btn, .duplicate-btn {
189
+ display: none !important;
 
 
 
 
 
190
  }
191
 
192
  /* Mobile responsive */
193
  @media (max-width: 768px) {
 
 
 
 
194
  .chatbot {
 
195
  max-width: 100% !important;
196
+ margin: 0 !important;
197
  }
198
 
199
  .message {
200
  max-width: 85% !important;
 
201
  }
202
  }
203
 
204
+ /* Remove any remaining blue elements */
205
+ .chatbot > div,
206
+ .chat-interface > div,
207
+ .gradio-container > div > div {
208
+ background: transparent !important;
 
 
 
 
 
 
 
 
209
  }
210
 
211
+ /* Ensure no floating elements */
212
+ .chatbot *[style*="position: absolute"],
213
+ .chatbot *[style*="position: fixed"] {
214
+ display: none !important;
215
  }
216
  """
217
 
218
+ # Create interface WITHOUT examples (no blue boxes!)
219
  demo = gr.ChatInterface(
220
  fn=chat_response,
221
  title="4AT Professional Assistant",
222
  description="Expert AI for Accounting, Audit, Advisory & Technology Services",
223
+ # NO EXAMPLES = NO BLUE BOXES!
224
+ css=clean_no_boxes_css,
 
 
 
 
 
 
 
225
  theme=gr.themes.Base()
226
  )
227
 
228
+ # Add simple footer
229
+ with demo:
230
+ gr.HTML("""
231
+ <div style="text-align: center; margin-top: 20px; color: #888; font-size: 12px;">
232
+ πŸ“ž +1 703 665 4255 | πŸ“§ info@consult-4at.com | 🌍 USA β€’ India β€’ Australia
233
+ </div>
234
+ """)
235
+
236
  if __name__ == "__main__":
237
  demo.launch(debug=False)