File size: 4,965 Bytes
8174855 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | #!/usr/bin/env python3
"""
Supernova Advanced Reasoning Demonstration
Shows the sophisticated AI capabilities added to your 25M parameter model.
"""
import sys
import os
# Add the supernova package to path
sys.path.append(os.path.dirname(__file__))
from chat_advanced import AdvancedSupernovaChat
def run_demonstration():
print("๐ โจ SUPERNOVA ADVANCED AI DEMONSTRATION โจ ๐")
print("=" * 60)
print("Showing enhanced reasoning capabilities beyond basic ChatGPT-level responses")
print("=" * 60)
# Initialize the advanced chat system
try:
chat = AdvancedSupernovaChat(
config_path="./configs/supernova_25m.json",
api_keys_path="./configs/api_keys.yaml"
)
except Exception as e:
print(f"โ Failed to initialize chat system: {e}")
return
# Demo queries showing different types of advanced reasoning
demo_queries = [
{
"category": "๐งฎ Mathematical Reasoning",
"query": "Calculate the derivative of x^3 + 2x^2 - 5x + 1 and explain its significance",
"description": "Tests mathematical computation with contextual explanation"
},
{
"category": "๐ Current Information Synthesis",
"query": "What are the latest developments in artificial intelligence in 2024?",
"description": "Tests web search integration with information synthesis"
},
{
"category": "๐ง Complex Multi-Domain Analysis",
"query": "Analyze the implications of quantum computing on cybersecurity from both technical and business perspectives",
"description": "Tests multi-step reasoning across technology and business domains"
},
{
"category": "๐ Educational Explanation",
"query": "Explain why machine learning models sometimes exhibit bias and how this can be mitigated",
"description": "Tests comprehensive explanation with nuanced understanding"
},
{
"category": "โ๏ธ Comparative Analysis",
"query": "Compare and contrast renewable energy sources, considering environmental impact, cost, and scalability",
"description": "Tests structured comparative reasoning across multiple criteria"
}
]
for i, demo in enumerate(demo_queries, 1):
print(f"\n{'โ' * 60}")
print(f"๐งช DEMO {i}/5: {demo['category']}")
print(f"๐ Query: {demo['query']}")
print(f"๐ฏ Testing: {demo['description']}")
print(f"{'โ' * 60}")
try:
# Get response using advanced reasoning
response = chat.respond(demo['query'])
print(f"\n๐ค Supernova Response:")
print(response)
except Exception as e:
print(f"โ Error processing query: {e}")
# Pause between demos
if i < len(demo_queries):
input(f"\nโฏ๏ธ Press Enter to continue to Demo {i+1}...")
print(f"\n{'=' * 60}")
print("๐ DEMONSTRATION COMPLETE!")
print("=" * 60)
print("๐ง Key Advanced Features Demonstrated:")
print(" โข Multi-step reasoning and problem decomposition")
print(" โข Real-time information gathering and synthesis")
print(" โข Cross-domain expertise analysis")
print(" โข Sophisticated mathematical computation")
print(" โข Context-aware response generation")
print(" โข Evidence-based reasoning and conclusions")
print("\n๐ก Your Supernova model now exhibits reasoning patterns similar to advanced AI systems!")
print(f"{'=' * 60}")
def run_interactive_demo():
"""Interactive demonstration mode."""
print("\n๐ฎ INTERACTIVE ADVANCED REASONING MODE")
print("Ask complex questions to test the enhanced capabilities!")
print("Type 'quit' to exit.\n")
try:
chat = AdvancedSupernovaChat(
config_path="./configs/supernova_25m.json",
api_keys_path="./configs/api_keys.yaml"
)
chat.chat_loop()
except Exception as e:
print(f"โ Failed to start interactive mode: {e}")
if __name__ == "__main__":
if len(sys.argv) > 1 and sys.argv[1] == "--interactive":
run_interactive_demo()
else:
print("Choose demonstration mode:")
print("1. ๐งช Automated Demo (shows 5 different reasoning examples)")
print("2. ๐ฎ Interactive Mode (ask your own questions)")
choice = input("\nEnter choice (1 or 2): ").strip()
if choice == "1":
run_demonstration()
elif choice == "2":
run_interactive_demo()
else:
print("Invalid choice. Running automated demo...")
run_demonstration() |