File size: 2,534 Bytes
8c64950
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/usr/bin/env python3
"""
πŸš€ JARVIS Quantum AI Suite - Deployment Verification
=====================================================

Quick test to ensure all components work before Hugging Face deployment.
"""

import sys
from pathlib import Path

def test_imports():
    """Test all critical imports"""
    print("πŸ” Testing imports...")
    
    # Test src modules
    try:
        sys.path.insert(0, str(Path(__file__).parent / "src"))
        
        # Test quantum LLM
        from quantum_llm import quantum_transformer
        print("βœ… Quantum LLM: OK")
        
        # Test thought compression
        from thought_compression import tcl_engine
        print("βœ… Thought Compression: OK")
        
        # Test core engines
        from core import adapter_engine
        print("βœ… Core Engines: OK")
        
    except Exception as e:
        print(f"❌ Import error: {e}")
        return False
    
    return True

def test_demo_modules():
    """Test demo modules"""
    print("\n🎭 Testing demo modules...")
    
    try:
        # Test cancer demo
        import gradio_quantum_cancer_demo
        print("βœ… Cancer Demo: OK")
        
        # Test Jarvis demo
        import jarvis_v1_gradio_space
        print("βœ… Jarvis Demo: OK")
        
    except Exception as e:
        print(f"❌ Demo error: {e}")
        return False
    
    return True

def test_main_app():
    """Test main app"""
    print("\nπŸš€ Testing main app...")
    
    try:
        # This will test if the main app can import everything
        import app
        print("βœ… Main App: OK")
        
        # Test interface creation
        demo = app.create_interface()
        print("βœ… Interface Creation: OK")
        
    except Exception as e:
        print(f"❌ App error: {e}")
        return False
    
    return True

def main():
    """Run all tests"""
    print("🌌 JARVIS Quantum AI Suite - Deployment Verification")
    print("=" * 55)
    
    tests = [
        test_imports,
        test_demo_modules, 
        test_main_app
    ]
    
    passed = 0
    for test in tests:
        if test():
            passed += 1
    
    print(f"\nπŸ“Š Results: {passed}/{len(tests)} tests passed")
    
    if passed == len(tests):
        print("πŸŽ‰ All tests passed! Ready for Hugging Face deployment!")
        return True
    else:
        print("❌ Some tests failed. Please fix before deployment.")
        return False

if __name__ == "__main__":
    success = main()
    sys.exit(0 if success else 1)