-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck_setup.py
More file actions
164 lines (143 loc) Β· 4.79 KB
/
Copy pathcheck_setup.py
File metadata and controls
164 lines (143 loc) Β· 4.79 KB
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
#!/usr/bin/env python3
"""
Setup validation script for iML AutoML Framework
Checks if the environment is properly configured for running multi-iteration AutoML.
"""
import os
import sys
from pathlib import Path
import importlib
def check_python_version():
"""Check if Python version is compatible."""
version = sys.version_info
if version.major < 3 or (version.major == 3 and version.minor < 8):
return False, f"Python {version.major}.{version.minor} (requires Python 3.8+)"
return True, f"Python {version.major}.{version.minor}.{version.micro}"
def check_dependencies():
"""Check if required dependencies are installed."""
required_packages = [
'pandas',
'numpy',
'scikit-learn',
'torch',
'transformers',
'xgboost',
'lightgbm',
'catboost',
'langchain',
'omegaconf',
'ydata_profiling',
'rich'
]
results = {}
for package in required_packages:
try:
module = importlib.import_module(package.replace('-', '_'))
version = getattr(module, '__version__', 'unknown')
results[package] = (True, version)
except ImportError:
results[package] = (False, "Not installed")
return results
def check_api_keys():
"""Check if LLM API keys are configured."""
api_keys = {
'GEMINI_API_KEY': 'Google Gemini (default)',
'OPENAI_API_KEY': 'OpenAI GPT',
'ANTHROPIC_API_KEY': 'Anthropic Claude',
'AWS_DEFAULT_REGION': 'AWS Bedrock'
}
results = {}
for key, provider in api_keys.items():
value = os.getenv(key)
if value:
# Mask the key for security
masked = f"{value[:8]}...{value[-4:]}" if len(value) > 12 else "***"
results[provider] = (True, masked)
else:
results[provider] = (False, "Not set")
return results
def check_file_structure():
"""Check if the project file structure is correct."""
required_paths = [
'src/iML',
'src/iML/agents',
'src/iML/core',
'src/iML/prompts',
'src/iML/llm',
'configs/default.yaml',
'requirements.txt'
]
results = {}
for path in required_paths:
full_path = Path(path)
results[path] = full_path.exists()
return results
def main():
"""Run all setup checks."""
print("π€ iML AutoML Framework - Setup Validation")
print("=" * 60)
# Check Python version
print("\nπ Python Version:")
py_ok, py_info = check_python_version()
status = "β
" if py_ok else "β"
print(f" {status} {py_info}")
# Check dependencies
print("\nπ¦ Dependencies:")
deps = check_dependencies()
all_deps_ok = True
for package, (installed, version) in deps.items():
status = "β
" if installed else "β"
print(f" {status} {package:<20} {version}")
if not installed:
all_deps_ok = False
# Check API keys
print("\nπ API Keys:")
api_keys = check_api_keys()
any_key_set = False
for provider, (configured, value) in api_keys.items():
status = "β
" if configured else "β οΈ "
print(f" {status} {provider:<25} {value}")
if configured:
any_key_set = True
# Check file structure
print("\nπ File Structure:")
files = check_file_structure()
all_files_ok = True
for path, exists in files.items():
status = "β
" if exists else "β"
print(f" {status} {path}")
if not exists:
all_files_ok = False
# Summary
print("\n" + "=" * 60)
print("π Setup Summary:")
checks = [
("Python Version", py_ok),
("Dependencies", all_deps_ok),
("API Keys", any_key_set),
("File Structure", all_files_ok)
]
all_good = True
for check_name, check_ok in checks:
status = "β
" if check_ok else "β"
print(f" {status} {check_name}")
if not check_ok:
all_good = False
if all_good:
print("\nπ Setup Complete! You're ready to run iML AutoML.")
print("\nQuick start:")
print(" python run_multi_iteration.py -i ./your_dataset")
else:
print("\nβ οΈ Setup Issues Found:")
if not py_ok:
print(" β’ Upgrade to Python 3.8 or higher")
if not all_deps_ok:
print(" β’ Install missing dependencies: pip install -r requirements.txt")
if not any_key_set:
print(" β’ Set up at least one API key (GEMINI_API_KEY recommended)")
if not all_files_ok:
print(" β’ Make sure you're running from the project root directory")
return all_good
if __name__ == "__main__":
success = main()
sys.exit(0 if success else 1)