-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck_requirements.py
More file actions
93 lines (75 loc) · 2.47 KB
/
check_requirements.py
File metadata and controls
93 lines (75 loc) · 2.47 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
#!/usr/bin/env python3
"""
Check if all required packages are installed.
"""
import importlib
import sys
def check_package(package_name, import_name=None):
"""Check if a package is installed."""
if import_name is None:
import_name = package_name
try:
importlib.import_module(import_name)
return True
except ImportError:
return False
def main():
"""Check all required packages."""
print("Checking required packages for Adaptive CoT Framework...")
print("=" * 60)
# Core dependencies
core_packages = [
("torch", "torch"),
("transformers", "transformers"),
("numpy", "numpy"),
("scipy", "scipy"),
("scikit-learn", "sklearn"),
("datasets", "datasets"),
("accelerate", "accelerate"),
("evaluate", "evaluate"),
("pyyaml", "yaml"),
("tqdm", "tqdm"),
("pandas", "pandas"),
("matplotlib", "matplotlib"),
("seaborn", "seaborn"),
]
# Optional dependencies
optional_packages = [
("vllm", "vllm"),
("lighteval", "lighteval"),
]
print("Core Dependencies:")
print("-" * 30)
missing_core = []
for package, import_name in core_packages:
if check_package(package, import_name):
print(f"✓ {package}")
else:
print(f"✗ {package} - MISSING")
missing_core.append(package)
print("\nOptional Dependencies:")
print("-" * 30)
missing_optional = []
for package, import_name in optional_packages:
if check_package(package, import_name):
print(f"✓ {package}")
else:
print(f"✗ {package} - MISSING (optional)")
missing_optional.append(package)
print("\n" + "=" * 60)
if missing_core:
print(f"❌ Missing core dependencies: {', '.join(missing_core)}")
print("\nInstall missing packages with:")
print(f"pip install {' '.join(missing_core)}")
return False
else:
print("✅ All core dependencies are installed!")
if missing_optional:
print(f"\n⚠️ Missing optional dependencies: {', '.join(missing_optional)}")
print("These are optional but recommended for full functionality:")
print(f"pip install {' '.join(missing_optional)}")
print("\n🎉 Framework is ready to use!")
return True
if __name__ == "__main__":
success = main()
sys.exit(0 if success else 1)