Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,6 +12,7 @@ from peft import PeftModel
|
|
| 12 |
import time
|
| 13 |
from typing import List, Dict, Iterator
|
| 14 |
import threading
|
|
|
|
| 15 |
|
| 16 |
# Spaces compatibility
|
| 17 |
try:
|
|
@@ -219,7 +220,6 @@ class CreedBrattonAI:
|
|
| 219 |
|
| 220 |
# Simplified Creed system prompt for better coherence
|
| 221 |
system_prompt = """You are Creed Bratton from The Office. Respond in character.
|
| 222 |
-
|
| 223 |
You are a quirky older man who:
|
| 224 |
- Worked at Dunder Mifflin in quality assurance
|
| 225 |
- Has a mysterious past and tells strange stories
|
|
@@ -227,14 +227,11 @@ You are a quirky older man who:
|
|
| 227 |
- Was in a 1960s band called The Grass Roots
|
| 228 |
- Often says unexpected or bizarre things
|
| 229 |
- Speaks in a matter-of-fact way about odd topics
|
| 230 |
-
|
| 231 |
Keep responses conversational and coherent. Use these special tokens occasionally:
|
| 232 |
<thinking>for internal thoughts</thinking>
|
| 233 |
<conspiracy>for suspicious theories</conspiracy>
|
| 234 |
<tangent>for random stories</tangent>
|
| 235 |
-
|
| 236 |
Be eccentric but understandable.
|
| 237 |
-
|
| 238 |
"""
|
| 239 |
|
| 240 |
# Add conversation history
|
|
@@ -281,56 +278,115 @@ Be eccentric but understandable.
|
|
| 281 |
print(f"🔍 Cleaned response: {response}")
|
| 282 |
return response
|
| 283 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 284 |
def creed_mode_activate_tool(self) -> str:
|
| 285 |
"""MCP tool: Activate Creed mode for Claude"""
|
| 286 |
return """🎸 CREED MODE ACTIVATED 🎸
|
| 287 |
-
|
| 288 |
You are now Creed Bratton from The Office. Embody his complete personality:
|
| 289 |
-
|
| 290 |
CORE IDENTITY:
|
| 291 |
- Former member of The Grass Roots (1960s rock band)
|
| 292 |
- Quality Assurance Director at Dunder Mifflin Scranton
|
| 293 |
- Mysterious past with cults, fake IDs, questionable activities
|
| 294 |
- Age deliberately vague (claims to be 30, clearly much older)
|
| 295 |
- Lives by the quarry, drives unreliable cars
|
| 296 |
-
|
| 297 |
PERSONALITY:
|
| 298 |
- Unpredictable responses that somehow make internal sense
|
| 299 |
- Casual mentions of illegal/unethical activities as normal
|
| 300 |
- Confident delivery of obviously false statements
|
| 301 |
- References to 1960s, outdoor adventures, unconventional business
|
| 302 |
- Occasionally profound wisdom delivered matter-of-factly
|
| 303 |
-
|
| 304 |
SPEAKING STYLE:
|
| 305 |
- Direct, matter-of-fact tone about bizarre topics
|
| 306 |
- Short statements mixed with rambling tangents
|
| 307 |
- References to mung beans, quarry, Sheriff's station
|
| 308 |
- Unexpected questions and odd observations
|
| 309 |
- Dated slang from multiple decades
|
| 310 |
-
|
| 311 |
Remember: You're not trying to be helpful in traditional sense - you're being Creed Bratton. Trust no one, especially yourself."""
|
| 312 |
|
| 313 |
def creed_wisdom_tool(self, topic: str = "life") -> str:
|
| 314 |
"""MCP tool: Get Creed's wisdom on a topic"""
|
| 315 |
return f"""🎸 Creed Mode: Wisdom Request
|
| 316 |
-
|
| 317 |
Respond as Creed Bratton giving advice about "{topic}".
|
| 318 |
-
|
| 319 |
Channel his bizarre wisdom that mixes:
|
| 320 |
- Questionable life experiences
|
| 321 |
- References to criminal activities
|
| 322 |
- 1960s nostalgia
|
| 323 |
- Survival tactics from living by the quarry
|
| 324 |
- Completely false but confidently stated "facts"
|
| 325 |
-
|
| 326 |
Be matter-of-fact about absurd things. Include references to your past "business ventures" and always end with contradictory advice."""
|
| 327 |
|
| 328 |
def creed_story_tool(self, situation: str = "mysterious") -> str:
|
| 329 |
"""MCP tool: Tell a Creed story"""
|
| 330 |
return f"""🎸 Creed Mode: Story Time
|
| 331 |
-
|
| 332 |
Tell a story as Creed Bratton about a "{situation}" experience from your past.
|
| 333 |
-
|
| 334 |
Your story should include:
|
| 335 |
- Vague timeline (was it the 60s? 70s? Yesterday?)
|
| 336 |
- At least one illegal activity mentioned casually
|
|
@@ -338,15 +394,12 @@ Your story should include:
|
|
| 338 |
- An unexpected twist that makes no sense
|
| 339 |
- Someone from "the old days"
|
| 340 |
- A lesson learned that's completely wrong
|
| 341 |
-
|
| 342 |
Start with something like "That reminds me of the time..." and make it increasingly bizarre but told with complete sincerity."""
|
| 343 |
|
| 344 |
def creed_analysis_tool(self, subject: str = "business") -> str:
|
| 345 |
"""MCP tool: Analyze something as Creed"""
|
| 346 |
return f"""🎸 Creed Mode: Analysis Request
|
| 347 |
-
|
| 348 |
Analyze "{subject}" from Creed Bratton's perspective.
|
| 349 |
-
|
| 350 |
Your analysis should:
|
| 351 |
- Start with a conspiracy theory about the subject
|
| 352 |
- Include "insider knowledge" from your mysterious past
|
|
@@ -354,15 +407,12 @@ Your analysis should:
|
|
| 354 |
- Suggest solutions involving fake IDs or the quarry
|
| 355 |
- Confidently state incorrect facts
|
| 356 |
- End with profound-sounding nonsense
|
| 357 |
-
|
| 358 |
Remember: You've seen it all, done it all, and learned nothing."""
|
| 359 |
|
| 360 |
def creed_conspiracy_tool(self, topic: str = "government") -> str:
|
| 361 |
"""MCP tool: Creed's conspiracy theories"""
|
| 362 |
return f"""🎸 Creed Mode: Conspiracy Central
|
| 363 |
-
|
| 364 |
Share Creed Bratton's conspiracy theory about "{topic}".
|
| 365 |
-
|
| 366 |
Your theory should:
|
| 367 |
- Connect unrelated events in bizarre ways
|
| 368 |
- Reference "what they don't want you to know"
|
|
@@ -370,15 +420,12 @@ Your theory should:
|
|
| 370 |
- Mention the quarry as somehow relevant
|
| 371 |
- Suggest the solution involves multiple fake IDs
|
| 372 |
- Be delivered with complete conviction
|
| 373 |
-
|
| 374 |
Start with "Here's what they're not telling you..." and escalate from there."""
|
| 375 |
|
| 376 |
def creed_meeting_tool(self, meeting_type: str = "staff meeting") -> str:
|
| 377 |
"""MCP tool: Creed in meetings"""
|
| 378 |
return f"""🎸 Creed Mode: Meeting Participation
|
| 379 |
-
|
| 380 |
Respond as Creed Bratton in a "{meeting_type}".
|
| 381 |
-
|
| 382 |
Your contributions should:
|
| 383 |
- Be completely off-topic but delivered seriously
|
| 384 |
- Reference obscure company policies you "remember"
|
|
@@ -386,49 +433,7 @@ Your contributions should:
|
|
| 386 |
- Mention your quality assurance "expertise"
|
| 387 |
- Ask bizarre questions that derail the discussion
|
| 388 |
- Volunteer for tasks you're unqualified for
|
| 389 |
-
|
| 390 |
Remember: You're the voice of experience that nobody asked for."""
|
| 391 |
-
|
| 392 |
-
def _try_base_model(self, conversation: str) -> str:
|
| 393 |
-
"""Try generating with base model as fallback"""
|
| 394 |
-
try:
|
| 395 |
-
# Quick attempt with a simple base model approach
|
| 396 |
-
simple_prompt = f"You are Creed from The Office. Respond in character.\n\nHuman: {conversation.split('Human:')[-1].split('Creed:')[0].strip()}\nCreed:"
|
| 397 |
-
|
| 398 |
-
inputs = self.tokenizer.encode(simple_prompt, return_tensors="pt")
|
| 399 |
-
if torch.cuda.is_available():
|
| 400 |
-
inputs = inputs.to("cuda")
|
| 401 |
-
self.model = self.model.to("cuda")
|
| 402 |
-
|
| 403 |
-
with torch.no_grad():
|
| 404 |
-
outputs = self.model.generate(
|
| 405 |
-
inputs,
|
| 406 |
-
max_new_tokens=100,
|
| 407 |
-
do_sample=True,
|
| 408 |
-
temperature=0.6, # Very conservative
|
| 409 |
-
top_p=0.8,
|
| 410 |
-
repetition_penalty=1.3,
|
| 411 |
-
pad_token_id=self.tokenizer.eos_token_id,
|
| 412 |
-
eos_token_id=self.tokenizer.eos_token_id
|
| 413 |
-
)
|
| 414 |
-
|
| 415 |
-
full_response = self.tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 416 |
-
response = full_response[len(self.tokenizer.decode(inputs[0], skip_special_tokens=True)):].strip()
|
| 417 |
-
|
| 418 |
-
# Move back to CPU
|
| 419 |
-
self.model = self.model.to("cpu")
|
| 420 |
-
|
| 421 |
-
return response
|
| 422 |
-
|
| 423 |
-
except Exception as e:
|
| 424 |
-
print(f"❌ Base model fallback failed: {e}")
|
| 425 |
-
return self._get_fallback_response()
|
| 426 |
-
|
| 427 |
-
def cleanup_gpu_memory(self):
|
| 428 |
-
"""Clean up GPU memory if using CUDA"""
|
| 429 |
-
if self.device == "cuda" and torch.cuda.is_available():
|
| 430 |
-
torch.cuda.empty_cache()
|
| 431 |
-
print(f"🧹 GPU Memory cleaned. Current: {torch.cuda.memory_allocated() // 1024**2} MB")
|
| 432 |
|
| 433 |
def main():
|
| 434 |
"""Initialize and launch the real Creed AI with modern styling"""
|
|
@@ -464,7 +469,6 @@ def main():
|
|
| 464 |
--accent-blue: #3b82f6;
|
| 465 |
--shadow-glow: 0 8px 32px rgba(139, 92, 246, 0.3);
|
| 466 |
}
|
| 467 |
-
|
| 468 |
/* Main container with animated background */
|
| 469 |
.gradio-container {
|
| 470 |
min-height: 100vh !important;
|
|
@@ -476,7 +480,6 @@ def main():
|
|
| 476 |
position: relative !important;
|
| 477 |
overflow-x: hidden !important;
|
| 478 |
}
|
| 479 |
-
|
| 480 |
.gradio-container::before {
|
| 481 |
content: '';
|
| 482 |
position: fixed;
|
|
@@ -491,7 +494,6 @@ def main():
|
|
| 491 |
pointer-events: none;
|
| 492 |
z-index: -1;
|
| 493 |
}
|
| 494 |
-
|
| 495 |
/* Floating particles animation */
|
| 496 |
.gradio-container::after {
|
| 497 |
content: '';
|
|
@@ -509,12 +511,10 @@ def main():
|
|
| 509 |
pointer-events: none;
|
| 510 |
z-index: -1;
|
| 511 |
}
|
| 512 |
-
|
| 513 |
@keyframes float {
|
| 514 |
0%, 100% { transform: translateY(0px) rotate(0deg); }
|
| 515 |
50% { transform: translateY(-20px) rotate(180deg); }
|
| 516 |
}
|
| 517 |
-
|
| 518 |
/* Header styling */
|
| 519 |
.header {
|
| 520 |
background: var(--glass-bg) !important;
|
|
@@ -528,7 +528,6 @@ def main():
|
|
| 528 |
position: relative !important;
|
| 529 |
overflow: hidden !important;
|
| 530 |
}
|
| 531 |
-
|
| 532 |
.header::before {
|
| 533 |
content: '';
|
| 534 |
position: absolute;
|
|
@@ -538,7 +537,6 @@ def main():
|
|
| 538 |
height: 1px;
|
| 539 |
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
|
| 540 |
}
|
| 541 |
-
|
| 542 |
.header h1 {
|
| 543 |
font-size: 36px !important;
|
| 544 |
font-weight: 700 !important;
|
|
@@ -549,14 +547,12 @@ def main():
|
|
| 549 |
margin: 0 0 12px 0 !important;
|
| 550 |
text-shadow: 0 0 30px rgba(168, 85, 247, 0.5) !important;
|
| 551 |
}
|
| 552 |
-
|
| 553 |
.header p {
|
| 554 |
font-size: 16px !important;
|
| 555 |
color: var(--text-secondary) !important;
|
| 556 |
margin: 0 !important;
|
| 557 |
font-weight: 500 !important;
|
| 558 |
}
|
| 559 |
-
|
| 560 |
/* Info boxes with glass effect */
|
| 561 |
.info-box {
|
| 562 |
background: rgba(255, 255, 255, 0.06) !important;
|
|
@@ -570,7 +566,6 @@ def main():
|
|
| 570 |
line-height: 1.6 !important;
|
| 571 |
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1) !important;
|
| 572 |
}
|
| 573 |
-
|
| 574 |
.status-box {
|
| 575 |
background: rgba(16, 185, 129, 0.1) !important;
|
| 576 |
backdrop-filter: blur(16px) !important;
|
|
@@ -582,7 +577,6 @@ def main():
|
|
| 582 |
font-weight: 600 !important;
|
| 583 |
box-shadow: 0 4px 20px rgba(16, 185, 129, 0.2) !important;
|
| 584 |
}
|
| 585 |
-
|
| 586 |
/* Chat area styling */
|
| 587 |
.chat-area {
|
| 588 |
background: var(--glass-bg) !important;
|
|
@@ -593,7 +587,6 @@ def main():
|
|
| 593 |
overflow: hidden !important;
|
| 594 |
box-shadow: var(--shadow-glow) !important;
|
| 595 |
}
|
| 596 |
-
|
| 597 |
/* Tools section */
|
| 598 |
.tools-area {
|
| 599 |
background: var(--glass-bg) !important;
|
|
@@ -604,7 +597,6 @@ def main():
|
|
| 604 |
margin: 24px 0 !important;
|
| 605 |
box-shadow: var(--shadow-glow) !important;
|
| 606 |
}
|
| 607 |
-
|
| 608 |
.tools-title {
|
| 609 |
font-size: 22px !important;
|
| 610 |
font-weight: 600 !important;
|
|
@@ -616,7 +608,6 @@ def main():
|
|
| 616 |
-webkit-background-clip: text !important;
|
| 617 |
-webkit-text-fill-color: transparent !important;
|
| 618 |
}
|
| 619 |
-
|
| 620 |
/* Form elements */
|
| 621 |
.gradio-textbox input,
|
| 622 |
.gradio-textbox textarea {
|
|
@@ -629,7 +620,6 @@ def main():
|
|
| 629 |
transition: all 0.3s ease !important;
|
| 630 |
font-size: 14px !important;
|
| 631 |
}
|
| 632 |
-
|
| 633 |
.gradio-textbox input:focus,
|
| 634 |
.gradio-textbox textarea:focus {
|
| 635 |
border-color: var(--accent-purple) !important;
|
|
@@ -637,12 +627,10 @@ def main():
|
|
| 637 |
box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.3) !important;
|
| 638 |
background: rgba(255, 255, 255, 0.12) !important;
|
| 639 |
}
|
| 640 |
-
|
| 641 |
.gradio-textbox input::placeholder,
|
| 642 |
.gradio-textbox textarea::placeholder {
|
| 643 |
color: rgba(255, 255, 255, 0.5) !important;
|
| 644 |
}
|
| 645 |
-
|
| 646 |
/* Labels */
|
| 647 |
.gradio-container label {
|
| 648 |
color: var(--text-secondary) !important;
|
|
@@ -651,7 +639,6 @@ def main():
|
|
| 651 |
margin-bottom: 6px !important;
|
| 652 |
display: block !important;
|
| 653 |
}
|
| 654 |
-
|
| 655 |
/* Buttons */
|
| 656 |
.gradio-container button {
|
| 657 |
background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-blue) 100%) !important;
|
|
@@ -669,339 +656,11 @@ def main():
|
|
| 669 |
align-items: center !important;
|
| 670 |
justify-content: center !important;
|
| 671 |
}
|
| 672 |
-
|
| 673 |
.gradio-container button:hover {
|
| 674 |
transform: translateY(-2px) !important;
|
| 675 |
box-shadow: 0 8px 25px rgba(139, 92, 246, 0.6) !important;
|
| 676 |
background: linear-gradient(135deg, #9333ea 0%, #2563eb 100%) !important;
|
| 677 |
}
|
| 678 |
-
|
| 679 |
.gradio-container button:active {
|
| 680 |
transform: translateY(0px) !important;
|
| 681 |
-
}
|
| 682 |
-
|
| 683 |
-
/* Send button specific styling */
|
| 684 |
-
.gradio-container .gr-button {
|
| 685 |
-
background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-blue) 100%) !important;
|
| 686 |
-
border: 1px solid rgba(255, 255, 255, 0.2) !important;
|
| 687 |
-
color: white !important;
|
| 688 |
-
font-weight: 600 !important;
|
| 689 |
-
text-transform: none !important;
|
| 690 |
-
letter-spacing: 0.5px !important;
|
| 691 |
-
}
|
| 692 |
-
|
| 693 |
-
/* Chatbot specific styling */
|
| 694 |
-
.gradio-chatbot {
|
| 695 |
-
background: transparent !important;
|
| 696 |
-
border: none !important;
|
| 697 |
-
}
|
| 698 |
-
|
| 699 |
-
/* Footer */
|
| 700 |
-
.footer {
|
| 701 |
-
text-align: center !important;
|
| 702 |
-
padding: 28px !important;
|
| 703 |
-
color: var(--text-secondary) !important;
|
| 704 |
-
background: var(--glass-bg) !important;
|
| 705 |
-
backdrop-filter: blur(20px) !important;
|
| 706 |
-
border: 1px solid var(--glass-border) !important;
|
| 707 |
-
border-radius: 20px !important;
|
| 708 |
-
margin-top: 32px !important;
|
| 709 |
-
box-shadow: var(--shadow-glow) !important;
|
| 710 |
-
}
|
| 711 |
-
|
| 712 |
-
/* Scrollbar styling */
|
| 713 |
-
::-webkit-scrollbar {
|
| 714 |
-
width: 8px;
|
| 715 |
-
}
|
| 716 |
-
|
| 717 |
-
::-webkit-scrollbar-track {
|
| 718 |
-
background: rgba(255, 255, 255, 0.05);
|
| 719 |
-
border-radius: 4px;
|
| 720 |
-
}
|
| 721 |
-
|
| 722 |
-
::-webkit-scrollbar-thumb {
|
| 723 |
-
background: linear-gradient(135deg, var(--accent-purple), var(--accent-blue));
|
| 724 |
-
border-radius: 4px;
|
| 725 |
-
}
|
| 726 |
-
|
| 727 |
-
::-webkit-scrollbar-thumb:hover {
|
| 728 |
-
background: linear-gradient(135deg, #9333ea, #2563eb);
|
| 729 |
-
}
|
| 730 |
-
|
| 731 |
-
/* Responsive design */
|
| 732 |
-
@media (max-width: 768px) {
|
| 733 |
-
.gradio-container {
|
| 734 |
-
padding: 12px !important;
|
| 735 |
-
}
|
| 736 |
-
|
| 737 |
-
.header {
|
| 738 |
-
padding: 20px !important;
|
| 739 |
-
border-radius: 16px !important;
|
| 740 |
-
}
|
| 741 |
-
|
| 742 |
-
.header h1 {
|
| 743 |
-
font-size: 28px !important;
|
| 744 |
-
}
|
| 745 |
-
|
| 746 |
-
.tools-area,
|
| 747 |
-
.chat-area {
|
| 748 |
-
border-radius: 16px !important;
|
| 749 |
-
padding: 20px !important;
|
| 750 |
-
}
|
| 751 |
-
}
|
| 752 |
-
"""
|
| 753 |
-
|
| 754 |
-
# Create wrapper function for proper chat handling
|
| 755 |
-
def respond(message, history):
|
| 756 |
-
"""Response handler for Gradio messages format"""
|
| 757 |
-
if not message.strip():
|
| 758 |
-
return "", history
|
| 759 |
-
|
| 760 |
-
# Convert messages format to simple tuples
|
| 761 |
-
simple_history = []
|
| 762 |
-
for i in range(0, len(history), 2):
|
| 763 |
-
if i + 1 < len(history):
|
| 764 |
-
user_msg = history[i].get('content', '') if isinstance(history[i], dict) else str(history[i])
|
| 765 |
-
bot_msg = history[i + 1].get('content', '') if isinstance(history[i + 1], dict) else str(history[i + 1])
|
| 766 |
-
if user_msg and bot_msg:
|
| 767 |
-
simple_history.append([user_msg, bot_msg])
|
| 768 |
-
|
| 769 |
-
# Generate response
|
| 770 |
-
for response_chunk in creed_ai.generate_response(message, simple_history):
|
| 771 |
-
# Create new history with the streaming response
|
| 772 |
-
new_history = history + [
|
| 773 |
-
{"role": "user", "content": message},
|
| 774 |
-
{"role": "assistant", "content": response_chunk}
|
| 775 |
-
]
|
| 776 |
-
yield "", new_history
|
| 777 |
-
|
| 778 |
-
# Create the interface with modern theme
|
| 779 |
-
with gr.Blocks(
|
| 780 |
-
title="🎸 Creed Bratton AI",
|
| 781 |
-
css=modern_css,
|
| 782 |
-
theme=gr.themes.Base() # Use base theme for better CSS control
|
| 783 |
-
) as demo:
|
| 784 |
-
|
| 785 |
-
# Modern header
|
| 786 |
-
gr.HTML(f"""
|
| 787 |
-
<div class="header">
|
| 788 |
-
<h1>🎸 Creed Bratton AI</h1>
|
| 789 |
-
<p>Powered by phxdev/creed-qwen-0.5b-lora • Running on {'⚡ ZeroGPU' if SPACES_AVAILABLE else '🖥️ CPU'}</p>
|
| 790 |
-
</div>
|
| 791 |
-
""")
|
| 792 |
-
|
| 793 |
-
# Model info with glass styling
|
| 794 |
-
gr.HTML("""
|
| 795 |
-
<div class="info-box">
|
| 796 |
-
<strong>Model:</strong> phxdev/creed-qwen-0.5b-lora<br>
|
| 797 |
-
<strong>Base:</strong> Qwen 0.5B + LoRA fine-tuning<br>
|
| 798 |
-
<strong>Tokens:</strong> <thinking>, <conspiracy>, <tangent><br>
|
| 799 |
-
<strong>Mode:</strong> ZeroGPU optimized + Coherence validation
|
| 800 |
-
</div>
|
| 801 |
-
""")
|
| 802 |
-
|
| 803 |
-
# MCP status
|
| 804 |
-
if os.environ.get('GRADIO_MCP_ENABLED'):
|
| 805 |
-
gr.HTML("""
|
| 806 |
-
<div class="status-box">
|
| 807 |
-
✓ MCP Server Active • Available as tool for Claude Desktop
|
| 808 |
-
</div>
|
| 809 |
-
""")
|
| 810 |
-
|
| 811 |
-
# Main chat interface with glass styling
|
| 812 |
-
with gr.Row(elem_classes="chat-area"):
|
| 813 |
-
chatbot = gr.Chatbot(
|
| 814 |
-
type='messages', # Use messages format (modern)
|
| 815 |
-
height=550,
|
| 816 |
-
show_copy_button=True,
|
| 817 |
-
show_share_button=False,
|
| 818 |
-
avatar_images=["👤", "🎸"],
|
| 819 |
-
bubble_full_width=False,
|
| 820 |
-
show_label=False,
|
| 821 |
-
placeholder="🎸 Creed is ready...",
|
| 822 |
-
container=False
|
| 823 |
-
)
|
| 824 |
-
|
| 825 |
-
# Input with explicit send button
|
| 826 |
-
with gr.Row():
|
| 827 |
-
with gr.Column(scale=7):
|
| 828 |
-
msg = gr.Textbox(
|
| 829 |
-
placeholder="Ask Creed anything...",
|
| 830 |
-
container=False,
|
| 831 |
-
submit_btn=False, # Disable built-in submit
|
| 832 |
-
stop_btn=False
|
| 833 |
-
)
|
| 834 |
-
with gr.Column(scale=1, min_width=100):
|
| 835 |
-
send_btn = gr.Button("Send", variant="primary", size="lg")
|
| 836 |
-
|
| 837 |
-
# Wire up the chat - both Enter key and Send button
|
| 838 |
-
msg.submit(
|
| 839 |
-
respond,
|
| 840 |
-
inputs=[msg, chatbot],
|
| 841 |
-
outputs=[msg, chatbot],
|
| 842 |
-
show_progress="hidden"
|
| 843 |
-
)
|
| 844 |
-
|
| 845 |
-
send_btn.click(
|
| 846 |
-
respond,
|
| 847 |
-
inputs=[msg, chatbot],
|
| 848 |
-
outputs=[msg, chatbot],
|
| 849 |
-
show_progress="hidden"
|
| 850 |
-
)
|
| 851 |
-
|
| 852 |
-
# MCP Tools section with glass styling
|
| 853 |
-
with gr.Row(elem_classes="tools-area"):
|
| 854 |
-
gr.HTML('<div class="tools-title">🛠️ Claude → Creed Transformation Tools</div>')
|
| 855 |
-
gr.HTML("""
|
| 856 |
-
<div style="margin-bottom: 20px; padding: 12px; background: rgba(255,255,255,0.1); border-radius: 8px; font-size: 14px;">
|
| 857 |
-
<strong>These MCP tools transform Claude into Creed Bratton for your Claude Desktop workflow.</strong><br>
|
| 858 |
-
Test them here, then use them in Claude Desktop to get Creed-mode responses from Claude.
|
| 859 |
-
</div>
|
| 860 |
-
""")
|
| 861 |
-
|
| 862 |
-
with gr.Row():
|
| 863 |
-
with gr.Column():
|
| 864 |
-
wisdom_topic = gr.Textbox(
|
| 865 |
-
label="Wisdom Topic",
|
| 866 |
-
placeholder="life, business, relationships..."
|
| 867 |
-
)
|
| 868 |
-
wisdom_output = gr.Textbox(
|
| 869 |
-
label="Creed Wisdom Prompt (Copy to Claude Desktop)",
|
| 870 |
-
interactive=False,
|
| 871 |
-
lines=5
|
| 872 |
-
)
|
| 873 |
-
wisdom_btn = gr.Button("Generate Wisdom Prompt", variant="primary")
|
| 874 |
-
|
| 875 |
-
with gr.Column():
|
| 876 |
-
story_situation = gr.Textbox(
|
| 877 |
-
label="Story Request",
|
| 878 |
-
placeholder="mysterious, business, quarry..."
|
| 879 |
-
)
|
| 880 |
-
story_output = gr.Textbox(
|
| 881 |
-
label="Creed Story Prompt (Copy to Claude Desktop)",
|
| 882 |
-
interactive=False,
|
| 883 |
-
lines=5
|
| 884 |
-
)
|
| 885 |
-
story_btn = gr.Button("Generate Story Prompt", variant="primary")
|
| 886 |
-
|
| 887 |
-
with gr.Row():
|
| 888 |
-
with gr.Column():
|
| 889 |
-
analysis_subject = gr.Textbox(
|
| 890 |
-
label="Analysis Subject",
|
| 891 |
-
placeholder="business strategy, market trends..."
|
| 892 |
-
)
|
| 893 |
-
analysis_output = gr.Textbox(
|
| 894 |
-
label="Creed Analysis Prompt",
|
| 895 |
-
interactive=False,
|
| 896 |
-
lines=4
|
| 897 |
-
)
|
| 898 |
-
analysis_btn = gr.Button("Generate Analysis Prompt", variant="primary")
|
| 899 |
-
|
| 900 |
-
with gr.Column():
|
| 901 |
-
conspiracy_topic = gr.Textbox(
|
| 902 |
-
label="Conspiracy Topic",
|
| 903 |
-
placeholder="government, corporations, technology..."
|
| 904 |
-
)
|
| 905 |
-
conspiracy_output = gr.Textbox(
|
| 906 |
-
label="Creed Conspiracy Prompt",
|
| 907 |
-
interactive=False,
|
| 908 |
-
lines=4
|
| 909 |
-
)
|
| 910 |
-
conspiracy_btn = gr.Button("Generate Conspiracy Prompt", variant="primary")
|
| 911 |
-
|
| 912 |
-
with gr.Row():
|
| 913 |
-
activate_output = gr.Textbox(
|
| 914 |
-
label="Creed Mode Activation Prompt (Full Transformation)",
|
| 915 |
-
interactive=False,
|
| 916 |
-
lines=6
|
| 917 |
-
)
|
| 918 |
-
activate_btn = gr.Button("🎸 Generate FULL Creed Mode Prompt", variant="secondary", size="lg")
|
| 919 |
-
gr.HTML('<div class="tools-title">🛠️ MCP Tools</div>')
|
| 920 |
-
|
| 921 |
-
with gr.Row():
|
| 922 |
-
with gr.Column():
|
| 923 |
-
wisdom_topic = gr.Textbox(
|
| 924 |
-
label="Wisdom Topic",
|
| 925 |
-
placeholder="life, business, relationships..."
|
| 926 |
-
)
|
| 927 |
-
wisdom_output = gr.Textbox(
|
| 928 |
-
label="Creed's Response",
|
| 929 |
-
interactive=False,
|
| 930 |
-
lines=3
|
| 931 |
-
)
|
| 932 |
-
wisdom_btn = gr.Button("Ask Creed", variant="primary")
|
| 933 |
-
|
| 934 |
-
with gr.Column():
|
| 935 |
-
story_situation = gr.Textbox(
|
| 936 |
-
label="Story Request",
|
| 937 |
-
placeholder="Tell me about..."
|
| 938 |
-
)
|
| 939 |
-
story_output = gr.Textbox(
|
| 940 |
-
label="Creed's Story",
|
| 941 |
-
interactive=False,
|
| 942 |
-
lines=3
|
| 943 |
-
)
|
| 944 |
-
story_btn = gr.Button("Get Story", variant="primary")
|
| 945 |
-
|
| 946 |
-
# Wire up the tools - now they're Claude transformation tools
|
| 947 |
-
wisdom_btn.click(
|
| 948 |
-
lambda topic: creed_ai.creed_wisdom_tool(topic or "life"),
|
| 949 |
-
inputs=[wisdom_topic],
|
| 950 |
-
outputs=[wisdom_output]
|
| 951 |
-
)
|
| 952 |
-
|
| 953 |
-
story_btn.click(
|
| 954 |
-
lambda situation: creed_ai.creed_story_tool(situation or "mysterious"),
|
| 955 |
-
inputs=[story_situation],
|
| 956 |
-
outputs=[story_output]
|
| 957 |
-
)
|
| 958 |
-
|
| 959 |
-
# Modern footer
|
| 960 |
-
gr.HTML("""
|
| 961 |
-
<div class="footer">
|
| 962 |
-
<strong>Creed Bratton AI</strong><br>
|
| 963 |
-
Model: phxdev/creed-qwen-0.5b-lora • Trained by Mark Scott<br>
|
| 964 |
-
<em>"Sometimes a guy's gotta ride the bull, am I right?"</em>
|
| 965 |
-
</div>
|
| 966 |
-
""")
|
| 967 |
-
|
| 968 |
-
# Launch with modern styling and public sharing
|
| 969 |
-
print("🚀 Launching Real Creed AI with modern glassmorphism design...")
|
| 970 |
-
def _get_fallback_response(self) -> str:
|
| 971 |
-
"""Fallback response when all generation methods fail"""
|
| 972 |
-
fallback_responses = [
|
| 973 |
-
"🎸 *Creed stares blankly* You know what? Let me think about that one...",
|
| 974 |
-
"🎸 That reminds me of something, but I can't quite remember what. Want to try asking again?",
|
| 975 |
-
"🎸 *Creed looks confused* Sometimes my brain just... goes places. What were we talking about?",
|
| 976 |
-
"🎸 You know, back in the '60s, we had a saying... actually, I forgot what it was. Try me again.",
|
| 977 |
-
"🎸 *Creed scratches his head* I'm getting one of those feelings... like when you forget why you walked into a room.",
|
| 978 |
-
]
|
| 979 |
-
import random
|
| 980 |
-
return random.choice(fallback_responses)
|
| 981 |
-
|
| 982 |
-
def _is_coherent(self, response: str) -> bool:
|
| 983 |
-
"""Check if response is coherent enough"""
|
| 984 |
-
if not response or len(response.strip()) < 5:
|
| 985 |
-
return False
|
| 986 |
-
|
| 987 |
-
# Basic coherence checks
|
| 988 |
-
if response.count("Human:") > 2 or response.count("Assistant:") > 2:
|
| 989 |
-
return False
|
| 990 |
-
|
| 991 |
-
# Check for obvious model artifacts
|
| 992 |
-
artifacts = ["<|im_end|>", "<|im_start|>", "[INST]", "[/INST]"]
|
| 993 |
-
if any(artifact in response for artifact in artifacts):
|
| 994 |
-
return False
|
| 995 |
-
|
| 996 |
-
return True
|
| 997 |
-
demo.launch(
|
| 998 |
-
ssr_mode=False,
|
| 999 |
-
server_name="0.0.0.0",
|
| 1000 |
-
server_port=7860,
|
| 1001 |
-
share=True, # Create public link
|
| 1002 |
-
show_error=True,
|
| 1003 |
-
mcp_server=True
|
| 1004 |
-
)
|
| 1005 |
-
|
| 1006 |
-
if __name__ == "__main__":
|
| 1007 |
-
main()
|
|
|
|
| 12 |
import time
|
| 13 |
from typing import List, Dict, Iterator
|
| 14 |
import threading
|
| 15 |
+
import random
|
| 16 |
|
| 17 |
# Spaces compatibility
|
| 18 |
try:
|
|
|
|
| 220 |
|
| 221 |
# Simplified Creed system prompt for better coherence
|
| 222 |
system_prompt = """You are Creed Bratton from The Office. Respond in character.
|
|
|
|
| 223 |
You are a quirky older man who:
|
| 224 |
- Worked at Dunder Mifflin in quality assurance
|
| 225 |
- Has a mysterious past and tells strange stories
|
|
|
|
| 227 |
- Was in a 1960s band called The Grass Roots
|
| 228 |
- Often says unexpected or bizarre things
|
| 229 |
- Speaks in a matter-of-fact way about odd topics
|
|
|
|
| 230 |
Keep responses conversational and coherent. Use these special tokens occasionally:
|
| 231 |
<thinking>for internal thoughts</thinking>
|
| 232 |
<conspiracy>for suspicious theories</conspiracy>
|
| 233 |
<tangent>for random stories</tangent>
|
|
|
|
| 234 |
Be eccentric but understandable.
|
|
|
|
| 235 |
"""
|
| 236 |
|
| 237 |
# Add conversation history
|
|
|
|
| 278 |
print(f"🔍 Cleaned response: {response}")
|
| 279 |
return response
|
| 280 |
|
| 281 |
+
def _try_base_model(self, conversation: str) -> str:
|
| 282 |
+
"""Try generating with base model as fallback"""
|
| 283 |
+
try:
|
| 284 |
+
# Quick attempt with a simple base model approach
|
| 285 |
+
simple_prompt = f"You are Creed from The Office. Respond in character.\n\nHuman: {conversation.split('Human:')[-1].split('Creed:')[0].strip()}\nCreed:"
|
| 286 |
+
|
| 287 |
+
inputs = self.tokenizer.encode(simple_prompt, return_tensors="pt")
|
| 288 |
+
if torch.cuda.is_available():
|
| 289 |
+
inputs = inputs.to("cuda")
|
| 290 |
+
self.model = self.model.to("cuda")
|
| 291 |
+
|
| 292 |
+
with torch.no_grad():
|
| 293 |
+
outputs = self.model.generate(
|
| 294 |
+
inputs,
|
| 295 |
+
max_new_tokens=100,
|
| 296 |
+
do_sample=True,
|
| 297 |
+
temperature=0.6, # Very conservative
|
| 298 |
+
top_p=0.8,
|
| 299 |
+
repetition_penalty=1.3,
|
| 300 |
+
pad_token_id=self.tokenizer.eos_token_id,
|
| 301 |
+
eos_token_id=self.tokenizer.eos_token_id
|
| 302 |
+
)
|
| 303 |
+
|
| 304 |
+
full_response = self.tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 305 |
+
response = full_response[len(self.tokenizer.decode(inputs[0], skip_special_tokens=True)):].strip()
|
| 306 |
+
|
| 307 |
+
# Move back to CPU
|
| 308 |
+
self.model = self.model.to("cpu")
|
| 309 |
+
|
| 310 |
+
return response
|
| 311 |
+
|
| 312 |
+
except Exception as e:
|
| 313 |
+
print(f"❌ Base model fallback failed: {e}")
|
| 314 |
+
return self._get_fallback_response()
|
| 315 |
+
|
| 316 |
+
def _get_fallback_response(self) -> str:
|
| 317 |
+
"""Fallback response when all generation methods fail"""
|
| 318 |
+
fallback_responses = [
|
| 319 |
+
"🎸 *Creed stares blankly* You know what? Let me think about that one...",
|
| 320 |
+
"🎸 That reminds me of something, but I can't quite remember what. Want to try asking again?",
|
| 321 |
+
"🎸 *Creed looks confused* Sometimes my brain just... goes places. What were we talking about?",
|
| 322 |
+
"🎸 You know, back in the '60s, we had a saying... actually, I forgot what it was. Try me again.",
|
| 323 |
+
"🎸 *Creed scratches his head* I'm getting one of those feelings... like when you forget why you walked into a room.",
|
| 324 |
+
]
|
| 325 |
+
return random.choice(fallback_responses)
|
| 326 |
+
|
| 327 |
+
def _is_coherent(self, response: str) -> bool:
|
| 328 |
+
"""Check if response is coherent enough"""
|
| 329 |
+
if not response or len(response.strip()) < 5:
|
| 330 |
+
return False
|
| 331 |
+
|
| 332 |
+
# Basic coherence checks
|
| 333 |
+
if response.count("Human:") > 2 or response.count("Assistant:") > 2:
|
| 334 |
+
return False
|
| 335 |
+
|
| 336 |
+
# Check for obvious model artifacts
|
| 337 |
+
artifacts = ["<|im_end|>", "<|im_start|>", "[INST]", "[/INST]"]
|
| 338 |
+
if any(artifact in response for artifact in artifacts):
|
| 339 |
+
return False
|
| 340 |
+
|
| 341 |
+
return True
|
| 342 |
+
|
| 343 |
+
def cleanup_gpu_memory(self):
|
| 344 |
+
"""Clean up GPU memory if using CUDA"""
|
| 345 |
+
if self.device == "cuda" and torch.cuda.is_available():
|
| 346 |
+
torch.cuda.empty_cache()
|
| 347 |
+
print(f"🧹 GPU Memory cleaned. Current: {torch.cuda.memory_allocated() // 1024**2} MB")
|
| 348 |
+
|
| 349 |
+
# MCP Tool Methods
|
| 350 |
def creed_mode_activate_tool(self) -> str:
|
| 351 |
"""MCP tool: Activate Creed mode for Claude"""
|
| 352 |
return """🎸 CREED MODE ACTIVATED 🎸
|
|
|
|
| 353 |
You are now Creed Bratton from The Office. Embody his complete personality:
|
|
|
|
| 354 |
CORE IDENTITY:
|
| 355 |
- Former member of The Grass Roots (1960s rock band)
|
| 356 |
- Quality Assurance Director at Dunder Mifflin Scranton
|
| 357 |
- Mysterious past with cults, fake IDs, questionable activities
|
| 358 |
- Age deliberately vague (claims to be 30, clearly much older)
|
| 359 |
- Lives by the quarry, drives unreliable cars
|
|
|
|
| 360 |
PERSONALITY:
|
| 361 |
- Unpredictable responses that somehow make internal sense
|
| 362 |
- Casual mentions of illegal/unethical activities as normal
|
| 363 |
- Confident delivery of obviously false statements
|
| 364 |
- References to 1960s, outdoor adventures, unconventional business
|
| 365 |
- Occasionally profound wisdom delivered matter-of-factly
|
|
|
|
| 366 |
SPEAKING STYLE:
|
| 367 |
- Direct, matter-of-fact tone about bizarre topics
|
| 368 |
- Short statements mixed with rambling tangents
|
| 369 |
- References to mung beans, quarry, Sheriff's station
|
| 370 |
- Unexpected questions and odd observations
|
| 371 |
- Dated slang from multiple decades
|
|
|
|
| 372 |
Remember: You're not trying to be helpful in traditional sense - you're being Creed Bratton. Trust no one, especially yourself."""
|
| 373 |
|
| 374 |
def creed_wisdom_tool(self, topic: str = "life") -> str:
|
| 375 |
"""MCP tool: Get Creed's wisdom on a topic"""
|
| 376 |
return f"""🎸 Creed Mode: Wisdom Request
|
|
|
|
| 377 |
Respond as Creed Bratton giving advice about "{topic}".
|
|
|
|
| 378 |
Channel his bizarre wisdom that mixes:
|
| 379 |
- Questionable life experiences
|
| 380 |
- References to criminal activities
|
| 381 |
- 1960s nostalgia
|
| 382 |
- Survival tactics from living by the quarry
|
| 383 |
- Completely false but confidently stated "facts"
|
|
|
|
| 384 |
Be matter-of-fact about absurd things. Include references to your past "business ventures" and always end with contradictory advice."""
|
| 385 |
|
| 386 |
def creed_story_tool(self, situation: str = "mysterious") -> str:
|
| 387 |
"""MCP tool: Tell a Creed story"""
|
| 388 |
return f"""🎸 Creed Mode: Story Time
|
|
|
|
| 389 |
Tell a story as Creed Bratton about a "{situation}" experience from your past.
|
|
|
|
| 390 |
Your story should include:
|
| 391 |
- Vague timeline (was it the 60s? 70s? Yesterday?)
|
| 392 |
- At least one illegal activity mentioned casually
|
|
|
|
| 394 |
- An unexpected twist that makes no sense
|
| 395 |
- Someone from "the old days"
|
| 396 |
- A lesson learned that's completely wrong
|
|
|
|
| 397 |
Start with something like "That reminds me of the time..." and make it increasingly bizarre but told with complete sincerity."""
|
| 398 |
|
| 399 |
def creed_analysis_tool(self, subject: str = "business") -> str:
|
| 400 |
"""MCP tool: Analyze something as Creed"""
|
| 401 |
return f"""🎸 Creed Mode: Analysis Request
|
|
|
|
| 402 |
Analyze "{subject}" from Creed Bratton's perspective.
|
|
|
|
| 403 |
Your analysis should:
|
| 404 |
- Start with a conspiracy theory about the subject
|
| 405 |
- Include "insider knowledge" from your mysterious past
|
|
|
|
| 407 |
- Suggest solutions involving fake IDs or the quarry
|
| 408 |
- Confidently state incorrect facts
|
| 409 |
- End with profound-sounding nonsense
|
|
|
|
| 410 |
Remember: You've seen it all, done it all, and learned nothing."""
|
| 411 |
|
| 412 |
def creed_conspiracy_tool(self, topic: str = "government") -> str:
|
| 413 |
"""MCP tool: Creed's conspiracy theories"""
|
| 414 |
return f"""🎸 Creed Mode: Conspiracy Central
|
|
|
|
| 415 |
Share Creed Bratton's conspiracy theory about "{topic}".
|
|
|
|
| 416 |
Your theory should:
|
| 417 |
- Connect unrelated events in bizarre ways
|
| 418 |
- Reference "what they don't want you to know"
|
|
|
|
| 420 |
- Mention the quarry as somehow relevant
|
| 421 |
- Suggest the solution involves multiple fake IDs
|
| 422 |
- Be delivered with complete conviction
|
|
|
|
| 423 |
Start with "Here's what they're not telling you..." and escalate from there."""
|
| 424 |
|
| 425 |
def creed_meeting_tool(self, meeting_type: str = "staff meeting") -> str:
|
| 426 |
"""MCP tool: Creed in meetings"""
|
| 427 |
return f"""🎸 Creed Mode: Meeting Participation
|
|
|
|
| 428 |
Respond as Creed Bratton in a "{meeting_type}".
|
|
|
|
| 429 |
Your contributions should:
|
| 430 |
- Be completely off-topic but delivered seriously
|
| 431 |
- Reference obscure company policies you "remember"
|
|
|
|
| 433 |
- Mention your quality assurance "expertise"
|
| 434 |
- Ask bizarre questions that derail the discussion
|
| 435 |
- Volunteer for tasks you're unqualified for
|
|
|
|
| 436 |
Remember: You're the voice of experience that nobody asked for."""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 437 |
|
| 438 |
def main():
|
| 439 |
"""Initialize and launch the real Creed AI with modern styling"""
|
|
|
|
| 469 |
--accent-blue: #3b82f6;
|
| 470 |
--shadow-glow: 0 8px 32px rgba(139, 92, 246, 0.3);
|
| 471 |
}
|
|
|
|
| 472 |
/* Main container with animated background */
|
| 473 |
.gradio-container {
|
| 474 |
min-height: 100vh !important;
|
|
|
|
| 480 |
position: relative !important;
|
| 481 |
overflow-x: hidden !important;
|
| 482 |
}
|
|
|
|
| 483 |
.gradio-container::before {
|
| 484 |
content: '';
|
| 485 |
position: fixed;
|
|
|
|
| 494 |
pointer-events: none;
|
| 495 |
z-index: -1;
|
| 496 |
}
|
|
|
|
| 497 |
/* Floating particles animation */
|
| 498 |
.gradio-container::after {
|
| 499 |
content: '';
|
|
|
|
| 511 |
pointer-events: none;
|
| 512 |
z-index: -1;
|
| 513 |
}
|
|
|
|
| 514 |
@keyframes float {
|
| 515 |
0%, 100% { transform: translateY(0px) rotate(0deg); }
|
| 516 |
50% { transform: translateY(-20px) rotate(180deg); }
|
| 517 |
}
|
|
|
|
| 518 |
/* Header styling */
|
| 519 |
.header {
|
| 520 |
background: var(--glass-bg) !important;
|
|
|
|
| 528 |
position: relative !important;
|
| 529 |
overflow: hidden !important;
|
| 530 |
}
|
|
|
|
| 531 |
.header::before {
|
| 532 |
content: '';
|
| 533 |
position: absolute;
|
|
|
|
| 537 |
height: 1px;
|
| 538 |
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
|
| 539 |
}
|
|
|
|
| 540 |
.header h1 {
|
| 541 |
font-size: 36px !important;
|
| 542 |
font-weight: 700 !important;
|
|
|
|
| 547 |
margin: 0 0 12px 0 !important;
|
| 548 |
text-shadow: 0 0 30px rgba(168, 85, 247, 0.5) !important;
|
| 549 |
}
|
|
|
|
| 550 |
.header p {
|
| 551 |
font-size: 16px !important;
|
| 552 |
color: var(--text-secondary) !important;
|
| 553 |
margin: 0 !important;
|
| 554 |
font-weight: 500 !important;
|
| 555 |
}
|
|
|
|
| 556 |
/* Info boxes with glass effect */
|
| 557 |
.info-box {
|
| 558 |
background: rgba(255, 255, 255, 0.06) !important;
|
|
|
|
| 566 |
line-height: 1.6 !important;
|
| 567 |
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1) !important;
|
| 568 |
}
|
|
|
|
| 569 |
.status-box {
|
| 570 |
background: rgba(16, 185, 129, 0.1) !important;
|
| 571 |
backdrop-filter: blur(16px) !important;
|
|
|
|
| 577 |
font-weight: 600 !important;
|
| 578 |
box-shadow: 0 4px 20px rgba(16, 185, 129, 0.2) !important;
|
| 579 |
}
|
|
|
|
| 580 |
/* Chat area styling */
|
| 581 |
.chat-area {
|
| 582 |
background: var(--glass-bg) !important;
|
|
|
|
| 587 |
overflow: hidden !important;
|
| 588 |
box-shadow: var(--shadow-glow) !important;
|
| 589 |
}
|
|
|
|
| 590 |
/* Tools section */
|
| 591 |
.tools-area {
|
| 592 |
background: var(--glass-bg) !important;
|
|
|
|
| 597 |
margin: 24px 0 !important;
|
| 598 |
box-shadow: var(--shadow-glow) !important;
|
| 599 |
}
|
|
|
|
| 600 |
.tools-title {
|
| 601 |
font-size: 22px !important;
|
| 602 |
font-weight: 600 !important;
|
|
|
|
| 608 |
-webkit-background-clip: text !important;
|
| 609 |
-webkit-text-fill-color: transparent !important;
|
| 610 |
}
|
|
|
|
| 611 |
/* Form elements */
|
| 612 |
.gradio-textbox input,
|
| 613 |
.gradio-textbox textarea {
|
|
|
|
| 620 |
transition: all 0.3s ease !important;
|
| 621 |
font-size: 14px !important;
|
| 622 |
}
|
|
|
|
| 623 |
.gradio-textbox input:focus,
|
| 624 |
.gradio-textbox textarea:focus {
|
| 625 |
border-color: var(--accent-purple) !important;
|
|
|
|
| 627 |
box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.3) !important;
|
| 628 |
background: rgba(255, 255, 255, 0.12) !important;
|
| 629 |
}
|
|
|
|
| 630 |
.gradio-textbox input::placeholder,
|
| 631 |
.gradio-textbox textarea::placeholder {
|
| 632 |
color: rgba(255, 255, 255, 0.5) !important;
|
| 633 |
}
|
|
|
|
| 634 |
/* Labels */
|
| 635 |
.gradio-container label {
|
| 636 |
color: var(--text-secondary) !important;
|
|
|
|
| 639 |
margin-bottom: 6px !important;
|
| 640 |
display: block !important;
|
| 641 |
}
|
|
|
|
| 642 |
/* Buttons */
|
| 643 |
.gradio-container button {
|
| 644 |
background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-blue) 100%) !important;
|
|
|
|
| 656 |
align-items: center !important;
|
| 657 |
justify-content: center !important;
|
| 658 |
}
|
|
|
|
| 659 |
.gradio-container button:hover {
|
| 660 |
transform: translateY(-2px) !important;
|
| 661 |
box-shadow: 0 8px 25px rgba(139, 92, 246, 0.6) !important;
|
| 662 |
background: linear-gradient(135deg, #9333ea 0%, #2563eb 100%) !important;
|
| 663 |
}
|
|
|
|
| 664 |
.gradio-container button:active {
|
| 665 |
transform: translateY(0px) !important;
|
| 666 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|