File size: 1,531 Bytes
c024705
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/usr/bin/env python3
"""
Setup script for AIMHSA with OpenAI client for Ollama
"""

import subprocess
import sys
import os

def install_requirements():
    """Install required packages"""
    print("πŸ“¦ Installing requirements...")
    try:
        subprocess.check_call([sys.executable, "-m", "pip", "install", "-r", "requirements_ollama.txt"])
        print("βœ… Requirements installed successfully!")
        return True
    except subprocess.CalledProcessError as e:
        print(f"❌ Failed to install requirements: {e}")
        return False

def check_ollama():
    """Check if Ollama is running"""
    print("πŸ” Checking Ollama...")
    try:
        import requests
        response = requests.get("http://localhost:11434/api/tags", timeout=5)
        if response.status_code == 200:
            print("βœ… Ollama is running!")
            return True
    except Exception:
        pass
    
    print("❌ Ollama is not running")
    print("πŸ’‘ Please start Ollama:")
    print("   1. Download from: https://ollama.ai")
    print("   2. Run: ollama serve")
    print("   3. Pull model: ollama pull llama3.2")
    return False

def main():
    print("="*60)
    print("🧠 AIMHSA Setup with OpenAI Client")
    print("="*60)
    
    # Install requirements
    if not install_requirements():
        return
    
    # Check Ollama
    check_ollama()
    
    print("\n" + "="*60)
    print("βœ… Setup complete!")
    print("πŸš€ Run: python run_aimhsa.py")
    print("="*60)

if __name__ == "__main__":
    main()