File size: 836 Bytes
0e038ee
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import torch
import transformers
import datasets
import peft
import accelerate
import platform


def verify():
    print(f"OS: {platform.system()} {platform.release()}")
    print(f"Python: {platform.python_version()}")
    print("-" * 20)
    print(f"PyTorch version: {torch.__version__}")
    print(f"Transformers version: {transformers.__version__}")
    print(f"Datasets version: {datasets.__version__}")
    print(f"PEFT version: {peft.__version__}")
    print(f"Accelerate version: {accelerate.__version__}")

    # Check for GPU
    if torch.cuda.is_available():
        print(f"GPU: {torch.cuda.get_device_name(0)} (CUDA available)")
    elif torch.backends.mps.is_available():
        print("GPU: Apple Silicon MPS available")
    else:
        print("GPU: Not available (using CPU)")


if __name__ == "__main__":
    verify()