phxdev commited on
Commit
44901ad
·
verified ·
1 Parent(s): 42dc841

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +415 -312
app.py CHANGED
@@ -1,345 +1,448 @@
1
- /* Creed AI - Modern Glassmorphism Design */
2
- :root {
3
- --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
4
- --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
5
- --glass-bg: rgba(255, 255, 255, 0.08);
6
- --glass-border: rgba(255, 255, 255, 0.18);
7
- --text-primary: #ffffff;
8
- --text-secondary: rgba(255, 255, 255, 0.8);
9
- --accent-purple: #8b5cf6;
10
- --accent-blue: #3b82f6;
11
- --shadow-glow: 0 8px 32px rgba(139, 92, 246, 0.3);
12
- }
13
-
14
- /* Main container with animated background */
15
- .gradio-container {
16
- min-height: 100vh !important;
17
- background: var(--primary-gradient) !important;
18
- background-attachment: fixed !important;
19
- font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
20
- color: var(--text-primary) !important;
21
- padding: 20px !important;
22
- position: relative !important;
23
- overflow-x: hidden !important;
24
- }
25
-
26
- .gradio-container::before {
27
- content: '';
28
- position: fixed;
29
- top: 0;
30
- left: 0;
31
- width: 100%;
32
- height: 100%;
33
- background:
34
- radial-gradient(circle at 20% 80%, rgba(139, 92, 246, 0.3) 0%, transparent 50%),
35
- radial-gradient(circle at 80% 20%, rgba(59, 130, 246, 0.3) 0%, transparent 50%),
36
- radial-gradient(circle at 40% 40%, rgba(167, 139, 250, 0.2) 0%, transparent 50%);
37
- pointer-events: none;
38
- z-index: -1;
39
- }
40
-
41
- /* Floating particles animation */
42
- .gradio-container::after {
43
- content: '';
44
- position: fixed;
45
- top: 0;
46
- left: 0;
47
- width: 100%;
48
- height: 100%;
49
- background-image:
50
- radial-gradient(2px 2px at 20px 30px, rgba(255, 255, 255, 0.3), transparent),
51
- radial-gradient(2px 2px at 40px 70px, rgba(139, 92, 246, 0.4), transparent),
52
- radial-gradient(1px 1px at 90px 40px, rgba(59, 130, 246, 0.3), transparent);
53
- background-size: 120px 120px;
54
- animation: float 20s ease-in-out infinite;
55
- pointer-events: none;
56
- z-index: -1;
57
- }
58
-
59
- @keyframes float {
60
- 0%, 100% { transform: translateY(0px) rotate(0deg); }
61
- 50% { transform: translateY(-20px) rotate(180deg); }
62
- }
63
-
64
- /* Glass container base */
65
- .glass-panel {
66
- background: var(--glass-bg) !important;
67
- backdrop-filter: blur(20px) !important;
68
- -webkit-backdrop-filter: blur(20px) !important;
69
- border: 1px solid var(--glass-border) !important;
70
- border-radius: 20px !important;
71
- box-shadow: var(--shadow-glow) !important;
72
- transition: all 0.3s ease !important;
73
- }
74
-
75
- .glass-panel:hover {
76
- transform: translateY(-2px) !important;
77
- box-shadow: 0 12px 40px rgba(139, 92, 246, 0.4) !important;
78
- }
79
-
80
- /* Header styling */
81
- .header {
82
- background: var(--glass-bg) !important;
83
- backdrop-filter: blur(20px) !important;
84
- border: 1px solid var(--glass-border) !important;
85
- border-radius: 24px !important;
86
- padding: 32px !important;
87
- margin-bottom: 24px !important;
88
- text-align: center !important;
89
- box-shadow: var(--shadow-glow) !important;
90
- position: relative !important;
91
- overflow: hidden !important;
92
- }
93
-
94
- .header::before {
95
- content: '';
96
- position: absolute;
97
- top: 0;
98
- left: 0;
99
- right: 0;
100
- height: 1px;
101
- background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
102
- }
103
 
104
- .header h1 {
105
- font-size: 36px !important;
106
- font-weight: 700 !important;
107
- background: linear-gradient(135deg, #ffffff 0%, #a855f7 50%, #3b82f6 100%) !important;
108
- -webkit-background-clip: text !important;
109
- -webkit-text-fill-color: transparent !important;
110
- background-clip: text !important;
111
- margin: 0 0 12px 0 !important;
112
- text-shadow: 0 0 30px rgba(168, 85, 247, 0.5) !important;
113
- }
 
114
 
115
- .header p {
116
- font-size: 16px !important;
117
- color: var(--text-secondary) !important;
118
- margin: 0 !important;
119
- font-weight: 500 !important;
120
- }
 
 
 
 
 
 
 
 
121
 
122
- /* Info boxes with glass effect */
123
- .info-box {
124
- background: rgba(255, 255, 255, 0.06) !important;
125
- backdrop-filter: blur(16px) !important;
126
- border: 1px solid rgba(255, 255, 255, 0.12) !important;
127
- border-radius: 16px !important;
128
- padding: 20px !important;
129
- margin: 16px 0 !important;
130
- color: var(--text-secondary) !important;
131
- font-size: 14px !important;
132
- line-height: 1.6 !important;
133
- box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1) !important;
134
- }
 
 
 
 
135
 
136
- .status-box {
137
- background: rgba(16, 185, 129, 0.1) !important;
138
- backdrop-filter: blur(16px) !important;
139
- border: 1px solid rgba(16, 185, 129, 0.3) !important;
140
- border-radius: 16px !important;
141
- padding: 16px 20px !important;
142
- margin: 16px 0 !important;
143
- color: #10b981 !important;
144
- font-weight: 600 !important;
145
- box-shadow: 0 4px 20px rgba(16, 185, 129, 0.2) !important;
146
- }
147
 
148
- /* Chat area styling */
149
- .chat-area {
150
- background: var(--glass-bg) !important;
151
- backdrop-filter: blur(20px) !important;
152
- border: 1px solid var(--glass-border) !important;
153
- border-radius: 20px !important;
154
- margin: 16px 0 !important;
155
- overflow: hidden !important;
156
- box-shadow: var(--shadow-glow) !important;
157
- }
 
 
 
158
 
159
- /* Chat messages */
160
- .message {
161
- background: rgba(255, 255, 255, 0.05) !important;
162
- backdrop-filter: blur(10px) !important;
163
- border-radius: 12px !important;
164
- border: 1px solid rgba(255, 255, 255, 0.1) !important;
165
- color: var(--text-primary) !important;
166
- margin: 8px !important;
167
- padding: 12px 16px !important;
168
- transition: all 0.2s ease !important;
169
- }
170
 
171
- .message:hover {
172
- background: rgba(255, 255, 255, 0.08) !important;
173
- transform: translateX(4px) !important;
174
- }
 
 
 
 
 
 
175
 
176
- /* Tools section */
177
- .tools-area {
178
- background: var(--glass-bg) !important;
179
- backdrop-filter: blur(20px) !important;
180
- border: 1px solid var(--glass-border) !important;
181
- border-radius: 20px !important;
182
- padding: 28px !important;
183
- margin: 24px 0 !important;
184
- box-shadow: var(--shadow-glow) !important;
185
- }
186
 
187
- .tools-title {
188
- font-size: 22px !important;
189
- font-weight: 600 !important;
190
- color: var(--text-primary) !important;
191
- margin: 0 0 20px 0 !important;
192
- padding-bottom: 12px !important;
193
- border-bottom: 1px solid rgba(255, 255, 255, 0.2) !important;
194
- background: linear-gradient(135deg, #ffffff 0%, #a855f7 100%) !important;
195
- -webkit-background-clip: text !important;
196
- -webkit-text-fill-color: transparent !important;
197
- }
 
 
198
 
199
- /* Form elements */
200
- .gradio-textbox input,
201
- .gradio-textbox textarea {
202
- background: rgba(255, 255, 255, 0.08) !important;
203
- backdrop-filter: blur(10px) !important;
204
- border: 1px solid rgba(255, 255, 255, 0.16) !important;
205
- color: var(--text-primary) !important;
206
- border-radius: 12px !important;
207
- padding: 12px 16px !important;
208
- transition: all 0.3s ease !important;
209
- font-size: 14px !important;
210
- }
211
 
212
- .gradio-textbox input:focus,
213
- .gradio-textbox textarea:focus {
214
- border-color: var(--accent-purple) !important;
215
- outline: none !important;
216
- box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.3) !important;
217
- background: rgba(255, 255, 255, 0.12) !important;
218
- }
 
 
 
219
 
220
- .gradio-textbox input::placeholder,
221
- .gradio-textbox textarea::placeholder {
222
- color: rgba(255, 255, 255, 0.5) !important;
223
- }
 
 
 
 
 
 
224
 
225
- /* Labels */
226
- .gradio-container label {
227
- color: var(--text-secondary) !important;
228
- font-weight: 500 !important;
229
- font-size: 14px !important;
230
- margin-bottom: 6px !important;
231
- display: block !important;
232
- }
 
 
 
233
 
234
- /* Buttons */
235
- .gradio-container button {
236
- background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-blue) 100%) !important;
237
- color: var(--text-primary) !important;
238
- border: none !important;
239
- border-radius: 12px !important;
240
- padding: 12px 24px !important;
241
- font-weight: 600 !important;
242
- cursor: pointer !important;
243
- transition: all 0.3s ease !important;
244
- box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4) !important;
245
- backdrop-filter: blur(10px) !important;
246
- }
247
 
248
- .gradio-container button:hover {
249
- transform: translateY(-2px) !important;
250
- box-shadow: 0 8px 25px rgba(139, 92, 246, 0.6) !important;
251
- background: linear-gradient(135deg, #9333ea 0%, #2563eb 100%) !important;
252
- }
 
 
253
 
254
- .gradio-container button:active {
255
- transform: translateY(0px) !important;
256
- }
 
257
 
258
- /* Chatbot specific styling */
259
- .gradio-chatbot {
260
- background: transparent !important;
261
- border: none !important;
262
- }
 
 
 
263
 
264
- .gradio-chatbot .message-wrap {
265
- background: rgba(255, 255, 255, 0.06) !important;
266
- backdrop-filter: blur(12px) !important;
267
- border-radius: 16px !important;
268
- border: 1px solid rgba(255, 255, 255, 0.12) !important;
269
- margin: 8px 0 !important;
270
- transition: all 0.2s ease !important;
271
- }
 
 
 
 
 
272
 
273
- .gradio-chatbot .message-wrap:hover {
274
- background: rgba(255, 255, 255, 0.1) !important;
275
- }
 
 
276
 
277
- /* Footer */
278
- .footer {
279
- text-align: center !important;
280
- padding: 28px !important;
281
- color: var(--text-secondary) !important;
282
- background: var(--glass-bg) !important;
283
- backdrop-filter: blur(20px) !important;
284
- border: 1px solid var(--glass-border) !important;
285
- border-radius: 20px !important;
286
- margin-top: 32px !important;
287
- box-shadow: var(--shadow-glow) !important;
288
- }
289
 
290
- /* Scrollbar styling */
291
- ::-webkit-scrollbar {
292
- width: 8px;
293
- }
 
294
 
295
- ::-webkit-scrollbar-track {
296
- background: rgba(255, 255, 255, 0.05);
297
- border-radius: 4px;
298
- }
 
 
 
 
 
 
 
 
299
 
300
- ::-webkit-scrollbar-thumb {
301
- background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
302
- border-radius: 4px;
303
- }
304
 
305
- ::-webkit-scrollbar-thumb:hover {
306
- background: linear-gradient(135deg, #9333ea, #2563eb);
307
- }
 
308
 
309
- /* Animation for new messages */
310
- @keyframes slideInFromRight {
311
- from {
312
- opacity: 0;
313
- transform: translateX(50px);
314
  }
315
- to {
316
- opacity: 1;
317
- transform: translateX(0);
318
  }
319
- }
320
 
321
- .gradio-chatbot .message-wrap {
322
- animation: slideInFromRight 0.4s ease-out;
323
- }
 
 
 
 
 
 
 
 
324
 
325
- /* Responsive design */
326
- @media (max-width: 768px) {
327
- .gradio-container {
328
- padding: 12px !important;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
329
  }
 
330
 
331
- .header {
332
- padding: 20px !important;
333
- border-radius: 16px !important;
334
- }
 
 
 
335
 
336
- .header h1 {
337
- font-size: 28px !important;
338
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
339
 
340
- .tools-area,
341
- .chat-area {
342
- border-radius: 16px !important;
343
- padding: 20px !important;
344
- }
345
- }
 
 
 
 
 
 
 
 
1
+ def main():
2
+ """Initialize and launch the real Creed AI with modern styling"""
3
+
4
+ print("🎸 Initializing REAL Creed Bratton AI...")
5
+ print("📡 Loading Mark's trained model: phxdev/creed-qwen-0.5b-lora")
6
+
7
+ # Initialize Creed AI
8
+ creed_ai = CreedBrattonAI()
9
+
10
+ if SPACES_AVAILABLE:
11
+ gpu_placeholder()
12
+ print("✅ Spaces compatibility enabled")
13
+
14
+ # Modern glassmorphism CSS
15
+ modern_css = """
16
+ /* Creed AI - Modern Glassmorphism Design */
17
+ :root {
18
+ --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
19
+ --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
20
+ --glass-bg: rgba(255, 255, 255, 0.08);
21
+ --glass-border: rgba(255, 255, 255, 0.18);
22
+ --text-primary: #ffffff;
23
+ --text-secondary: rgba(255, 255, 255, 0.8);
24
+ --accent-purple: #8b5cf6;
25
+ --accent-blue: #3b82f6;
26
+ --shadow-glow: 0 8px 32px rgba(139, 92, 246, 0.3);
27
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
 
29
+ /* Main container with animated background */
30
+ .gradio-container {
31
+ min-height: 100vh !important;
32
+ background: var(--primary-gradient) !important;
33
+ background-attachment: fixed !important;
34
+ font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
35
+ color: var(--text-primary) !important;
36
+ padding: 20px !important;
37
+ position: relative !important;
38
+ overflow-x: hidden !important;
39
+ }
40
 
41
+ .gradio-container::before {
42
+ content: '';
43
+ position: fixed;
44
+ top: 0;
45
+ left: 0;
46
+ width: 100%;
47
+ height: 100%;
48
+ background:
49
+ radial-gradient(circle at 20% 80%, rgba(139, 92, 246, 0.3) 0%, transparent 50%),
50
+ radial-gradient(circle at 80% 20%, rgba(59, 130, 246, 0.3) 0%, transparent 50%),
51
+ radial-gradient(circle at 40% 40%, rgba(167, 139, 250, 0.2) 0%, transparent 50%);
52
+ pointer-events: none;
53
+ z-index: -1;
54
+ }
55
 
56
+ /* Floating particles animation */
57
+ .gradio-container::after {
58
+ content: '';
59
+ position: fixed;
60
+ top: 0;
61
+ left: 0;
62
+ width: 100%;
63
+ height: 100%;
64
+ background-image:
65
+ radial-gradient(2px 2px at 20px 30px, rgba(255, 255, 255, 0.3), transparent),
66
+ radial-gradient(2px 2px at 40px 70px, rgba(139, 92, 246, 0.4), transparent),
67
+ radial-gradient(1px 1px at 90px 40px, rgba(59, 130, 246, 0.3), transparent);
68
+ background-size: 120px 120px;
69
+ animation: float 20s ease-in-out infinite;
70
+ pointer-events: none;
71
+ z-index: -1;
72
+ }
73
 
74
+ @keyframes float {
75
+ 0%, 100% { transform: translateY(0px) rotate(0deg); }
76
+ 50% { transform: translateY(-20px) rotate(180deg); }
77
+ }
 
 
 
 
 
 
 
78
 
79
+ /* Header styling */
80
+ .header {
81
+ background: var(--glass-bg) !important;
82
+ backdrop-filter: blur(20px) !important;
83
+ border: 1px solid var(--glass-border) !important;
84
+ border-radius: 24px !important;
85
+ padding: 32px !important;
86
+ margin-bottom: 24px !important;
87
+ text-align: center !important;
88
+ box-shadow: var(--shadow-glow) !important;
89
+ position: relative !important;
90
+ overflow: hidden !important;
91
+ }
92
 
93
+ .header::before {
94
+ content: '';
95
+ position: absolute;
96
+ top: 0;
97
+ left: 0;
98
+ right: 0;
99
+ height: 1px;
100
+ background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
101
+ }
 
 
102
 
103
+ .header h1 {
104
+ font-size: 36px !important;
105
+ font-weight: 700 !important;
106
+ background: linear-gradient(135deg, #ffffff 0%, #a855f7 50%, #3b82f6 100%) !important;
107
+ -webkit-background-clip: text !important;
108
+ -webkit-text-fill-color: transparent !important;
109
+ background-clip: text !important;
110
+ margin: 0 0 12px 0 !important;
111
+ text-shadow: 0 0 30px rgba(168, 85, 247, 0.5) !important;
112
+ }
113
 
114
+ .header p {
115
+ font-size: 16px !important;
116
+ color: var(--text-secondary) !important;
117
+ margin: 0 !important;
118
+ font-weight: 500 !important;
119
+ }
 
 
 
 
120
 
121
+ /* Info boxes with glass effect */
122
+ .info-box {
123
+ background: rgba(255, 255, 255, 0.06) !important;
124
+ backdrop-filter: blur(16px) !important;
125
+ border: 1px solid rgba(255, 255, 255, 0.12) !important;
126
+ border-radius: 16px !important;
127
+ padding: 20px !important;
128
+ margin: 16px 0 !important;
129
+ color: var(--text-secondary) !important;
130
+ font-size: 14px !important;
131
+ line-height: 1.6 !important;
132
+ box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1) !important;
133
+ }
134
 
135
+ .status-box {
136
+ background: rgba(16, 185, 129, 0.1) !important;
137
+ backdrop-filter: blur(16px) !important;
138
+ border: 1px solid rgba(16, 185, 129, 0.3) !important;
139
+ border-radius: 16px !important;
140
+ padding: 16px 20px !important;
141
+ margin: 16px 0 !important;
142
+ color: #10b981 !important;
143
+ font-weight: 600 !important;
144
+ box-shadow: 0 4px 20px rgba(16, 185, 129, 0.2) !important;
145
+ }
 
146
 
147
+ /* Chat area styling */
148
+ .chat-area {
149
+ background: var(--glass-bg) !important;
150
+ backdrop-filter: blur(20px) !important;
151
+ border: 1px solid var(--glass-border) !important;
152
+ border-radius: 20px !important;
153
+ margin: 16px 0 !important;
154
+ overflow: hidden !important;
155
+ box-shadow: var(--shadow-glow) !important;
156
+ }
157
 
158
+ /* Tools section */
159
+ .tools-area {
160
+ background: var(--glass-bg) !important;
161
+ backdrop-filter: blur(20px) !important;
162
+ border: 1px solid var(--glass-border) !important;
163
+ border-radius: 20px !important;
164
+ padding: 28px !important;
165
+ margin: 24px 0 !important;
166
+ box-shadow: var(--shadow-glow) !important;
167
+ }
168
 
169
+ .tools-title {
170
+ font-size: 22px !important;
171
+ font-weight: 600 !important;
172
+ color: var(--text-primary) !important;
173
+ margin: 0 0 20px 0 !important;
174
+ padding-bottom: 12px !important;
175
+ border-bottom: 1px solid rgba(255, 255, 255, 0.2) !important;
176
+ background: linear-gradient(135deg, #ffffff 0%, #a855f7 100%) !important;
177
+ -webkit-background-clip: text !important;
178
+ -webkit-text-fill-color: transparent !important;
179
+ }
180
 
181
+ /* Form elements */
182
+ .gradio-textbox input,
183
+ .gradio-textbox textarea {
184
+ background: rgba(255, 255, 255, 0.08) !important;
185
+ backdrop-filter: blur(10px) !important;
186
+ border: 1px solid rgba(255, 255, 255, 0.16) !important;
187
+ color: var(--text-primary) !important;
188
+ border-radius: 12px !important;
189
+ padding: 12px 16px !important;
190
+ transition: all 0.3s ease !important;
191
+ font-size: 14px !important;
192
+ }
 
193
 
194
+ .gradio-textbox input:focus,
195
+ .gradio-textbox textarea:focus {
196
+ border-color: var(--accent-purple) !important;
197
+ outline: none !important;
198
+ box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.3) !important;
199
+ background: rgba(255, 255, 255, 0.12) !important;
200
+ }
201
 
202
+ .gradio-textbox input::placeholder,
203
+ .gradio-textbox textarea::placeholder {
204
+ color: rgba(255, 255, 255, 0.5) !important;
205
+ }
206
 
207
+ /* Labels */
208
+ .gradio-container label {
209
+ color: var(--text-secondary) !important;
210
+ font-weight: 500 !important;
211
+ font-size: 14px !important;
212
+ margin-bottom: 6px !important;
213
+ display: block !important;
214
+ }
215
 
216
+ /* Buttons */
217
+ .gradio-container button {
218
+ background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-blue) 100%) !important;
219
+ color: var(--text-primary) !important;
220
+ border: none !important;
221
+ border-radius: 12px !important;
222
+ padding: 12px 24px !important;
223
+ font-weight: 600 !important;
224
+ cursor: pointer !important;
225
+ transition: all 0.3s ease !important;
226
+ box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4) !important;
227
+ backdrop-filter: blur(10px) !important;
228
+ }
229
 
230
+ .gradio-container button:hover {
231
+ transform: translateY(-2px) !important;
232
+ box-shadow: 0 8px 25px rgba(139, 92, 246, 0.6) !important;
233
+ background: linear-gradient(135deg, #9333ea 0%, #2563eb 100%) !important;
234
+ }
235
 
236
+ .gradio-container button:active {
237
+ transform: translateY(0px) !important;
238
+ }
 
 
 
 
 
 
 
 
 
239
 
240
+ /* Chatbot specific styling */
241
+ .gradio-chatbot {
242
+ background: transparent !important;
243
+ border: none !important;
244
+ }
245
 
246
+ /* Footer */
247
+ .footer {
248
+ text-align: center !important;
249
+ padding: 28px !important;
250
+ color: var(--text-secondary) !important;
251
+ background: var(--glass-bg) !important;
252
+ backdrop-filter: blur(20px) !important;
253
+ border: 1px solid var(--glass-border) !important;
254
+ border-radius: 20px !important;
255
+ margin-top: 32px !important;
256
+ box-shadow: var(--shadow-glow) !important;
257
+ }
258
 
259
+ /* Scrollbar styling */
260
+ ::-webkit-scrollbar {
261
+ width: 8px;
262
+ }
263
 
264
+ ::-webkit-scrollbar-track {
265
+ background: rgba(255, 255, 255, 0.05);
266
+ border-radius: 4px;
267
+ }
268
 
269
+ ::-webkit-scrollbar-thumb {
270
+ background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
271
+ border-radius: 4px;
 
 
272
  }
273
+
274
+ ::-webkit-scrollbar-thumb:hover {
275
+ background: linear-gradient(135deg, #9333ea, #2563eb);
276
  }
 
277
 
278
+ /* Animation for new messages */
279
+ @keyframes slideInFromRight {
280
+ from {
281
+ opacity: 0;
282
+ transform: translateX(50px);
283
+ }
284
+ to {
285
+ opacity: 1;
286
+ transform: translateX(0);
287
+ }
288
+ }
289
 
290
+ /* Responsive design */
291
+ @media (max-width: 768px) {
292
+ .gradio-container {
293
+ padding: 12px !important;
294
+ }
295
+
296
+ .header {
297
+ padding: 20px !important;
298
+ border-radius: 16px !important;
299
+ }
300
+
301
+ .header h1 {
302
+ font-size: 28px !important;
303
+ }
304
+
305
+ .tools-area,
306
+ .chat-area {
307
+ border-radius: 16px !important;
308
+ padding: 20px !important;
309
+ }
310
  }
311
+ """
312
 
313
+ # Create wrapper function for proper chat handling
314
+ def respond(message, history):
315
+ """Simple response handler for Gradio"""
316
+ for response_chunk in creed_ai.generate_response(message, history):
317
+ # Update the history with the current response
318
+ updated_history = history + [[message, response_chunk]]
319
+ yield "", updated_history
320
 
321
+ # Create the interface with modern theme
322
+ with gr.Blocks(
323
+ title="🎸 Creed Bratton AI",
324
+ css=modern_css,
325
+ theme=gr.themes.Base() # Use base theme for better CSS control
326
+ ) as demo:
327
+
328
+ # Modern header
329
+ gr.HTML("""
330
+ <div class="header">
331
+ <h1>🎸 Creed Bratton AI</h1>
332
+ <p>Powered by phxdev/creed-qwen-0.5b-lora • Enterprise-grade unpredictability</p>
333
+ </div>
334
+ """)
335
+
336
+ # Model info with glass styling
337
+ gr.HTML("""
338
+ <div class="info-box">
339
+ <strong>Model:</strong> phxdev/creed-qwen-0.5b-lora<br>
340
+ <strong>Base:</strong> Qwen 0.5B + LoRA fine-tuning<br>
341
+ <strong>Tokens:</strong> &lt;thinking&gt;, &lt;conspiracy&gt;, &lt;tangent&gt;
342
+ </div>
343
+ """)
344
+
345
+ # MCP status
346
+ if os.environ.get('GRADIO_MCP_ENABLED'):
347
+ gr.HTML("""
348
+ <div class="status-box">
349
+ ✓ MCP Server Active • Available as tool for Claude Desktop
350
+ </div>
351
+ """)
352
+
353
+ # Main chat interface with glass styling
354
+ with gr.Row(elem_classes="chat-area"):
355
+ chatbot = gr.Chatbot(
356
+ type='tuples', # Use tuples for simpler handling
357
+ height=550,
358
+ show_copy_button=True,
359
+ show_share_button=False,
360
+ avatar_images=["👤", "🎸"],
361
+ bubble_full_width=False,
362
+ show_label=False,
363
+ placeholder="🎸 Creed is ready...",
364
+ container=False
365
+ )
366
+
367
+ # Input with better styling
368
+ with gr.Row():
369
+ msg = gr.Textbox(
370
+ placeholder="Ask Creed anything...",
371
+ container=False,
372
+ scale=7,
373
+ submit_btn=True,
374
+ stop_btn=True
375
+ )
376
+
377
+ # Wire up the chat
378
+ msg.submit(
379
+ respond,
380
+ inputs=[msg, chatbot],
381
+ outputs=[msg, chatbot],
382
+ show_progress="hidden"
383
+ )
384
+
385
+ # MCP Tools section with glass styling
386
+ with gr.Row(elem_classes="tools-area"):
387
+ gr.HTML('<div class="tools-title">🛠️ MCP Tools</div>')
388
+
389
+ with gr.Row():
390
+ with gr.Column():
391
+ wisdom_topic = gr.Textbox(
392
+ label="Wisdom Topic",
393
+ placeholder="life, business, relationships..."
394
+ )
395
+ wisdom_output = gr.Textbox(
396
+ label="Creed's Response",
397
+ interactive=False,
398
+ lines=3
399
+ )
400
+ wisdom_btn = gr.Button("Ask Creed", variant="primary")
401
+
402
+ with gr.Column():
403
+ story_situation = gr.Textbox(
404
+ label="Story Request",
405
+ placeholder="Tell me about..."
406
+ )
407
+ story_output = gr.Textbox(
408
+ label="Creed's Story",
409
+ interactive=False,
410
+ lines=3
411
+ )
412
+ story_btn = gr.Button("Get Story", variant="primary")
413
+
414
+ # Wire up the tools
415
+ wisdom_btn.click(
416
+ creed_ai.creed_wisdom_tool,
417
+ inputs=[wisdom_topic],
418
+ outputs=[wisdom_output]
419
+ )
420
+
421
+ story_btn.click(
422
+ creed_ai.creed_story_tool,
423
+ inputs=[story_situation],
424
+ outputs=[story_output]
425
+ )
426
+
427
+ # Modern footer
428
+ gr.HTML("""
429
+ <div class="footer">
430
+ <strong>Creed Bratton AI</strong><br>
431
+ Model: phxdev/creed-qwen-0.5b-lora • Trained by Mark Scott<br>
432
+ <em>"Sometimes a guy's gotta ride the bull, am I right?"</em>
433
+ </div>
434
+ """)
435
 
436
+ # Launch with modern styling
437
+ print("🚀 Launching Real Creed AI with modern glassmorphism design...")
438
+
439
+ demo.launch(
440
+ ssr_mode=False,
441
+ server_name="0.0.0.0",
442
+ server_port=7860,
443
+ share=False,
444
+ show_error=True
445
+ )
446
+
447
+ if __name__ == "__main__":
448
+ main()