| |
|
| | """
|
| | Supernova Advanced Reasoning Demonstration
|
| | Shows the sophisticated AI capabilities added to your 25M parameter model.
|
| | """
|
| |
|
| | import sys
|
| | import os
|
| |
|
| |
|
| | 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)
|
| |
|
| |
|
| | 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 = [
|
| | {
|
| | "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:
|
| |
|
| | response = chat.respond(demo['query'])
|
| | print(f"\n๐ค Supernova Response:")
|
| | print(response)
|
| |
|
| | except Exception as e:
|
| | print(f"โ Error processing query: {e}")
|
| |
|
| |
|
| | 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() |