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
import os
import sys
import json
from detect_system import get_system_info
def main():
"""Check system configuration and start the application"""
print("Checking system configuration...")
# Get system info
system_info = get_system_info()
# Print system info
print(f"PyTorch available: {system_info['pytorch_available']}")
print(f"CUDA available: {system_info['cuda_available']}")
if system_info['cuda_available']:
print(f"CUDA version: {system_info['cuda_version']}")
print("GPU information:")
for gpu in system_info['gpu_info']:
print(f" - {gpu}")
print(f"CPU: {system_info['cpu_info']}")
print(f"Available memory: {system_info['memory_available']}")
# Check if PyTorch is available
if not system_info['pytorch_available']:
print("ERROR: PyTorch is not installed. Please install PyTorch.")
print("Visit https://pytorch.org/get-started/locally/ for installation instructions.")
sys.exit(1)
# Start the FastAPI server
print("\nStarting the AI Fine-Tuning server...")
os.system("uvicorn server:app --host 0.0.0.0 --port 8000 --reload")
if __name__ == "__main__":
main()No Output
Run the code to generate an output.