-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathverify_installation.py
More file actions
executable file
·81 lines (61 loc) · 2.34 KB
/
verify_installation.py
File metadata and controls
executable file
·81 lines (61 loc) · 2.34 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
#!/usr/bin/env python3
"""
Verification script to check if installation is complete and working.
Run this after installing dependencies to verify everything is set up correctly.
"""
import sys
def check_imports():
"""Check that all required modules can be imported."""
print("Checking module imports...")
try:
from lora_finetune import utils, data, training, inference, ui
print("✓ All lora_finetune modules import successfully")
except ImportError as e:
print(f"✗ Failed to import lora_finetune modules: {e}")
return False
try:
import gradio
print(f"✓ Gradio {gradio.__version__} is installed")
except ImportError:
print("✗ Gradio is not installed")
return False
try:
import torch
print(f"✓ PyTorch {torch.__version__} is installed")
cuda_available = torch.cuda.is_available()
if cuda_available:
print(f"✓ CUDA is available: {torch.cuda.get_device_name(0)}")
else:
print("⚠ CUDA is not available (GPU required for training/inference)")
except ImportError:
print("✗ PyTorch is not installed")
return False
return True
def check_functionality():
"""Check that basic functionality works."""
print("\nChecking basic functionality...")
from lora_finetune import utils, training
models = utils.get_model_zoo()
print(f"✓ Model zoo has {len(models)} models: {', '.join(models)}")
loras = utils.get_lora_gallery()
print(f"✓ LoRA gallery has {len(loras)} LoRAs: {', '.join(loras)}")
cmd, status = training.train_lora('/tmp/test', 'test-model', '/tmp/out')
print(f"✓ Training command generation works")
return True
def main():
print("LoRA Fine-Tuning Installation Verification")
print("=" * 50)
if not check_imports():
print("\n✗ Installation verification FAILED")
print("Run: pip install -r requirements.txt")
return 1
if not check_functionality():
print("\n✗ Functionality verification FAILED")
return 1
print("\n" + "=" * 50)
print("✓ All checks passed! Installation is complete.")
print("\nTo launch the app, run:")
print(" python scripts/run_app.py")
return 0
if __name__ == "__main__":
sys.exit(main())